[[package]]
name = "cargo-platform"
-version = "0.1.1"
+version = "0.1.2"
dependencies = [
"serde",
]
[[package]]
name = "jobserver"
-version = "0.1.22"
+version = "0.1.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd"
+checksum = "f5ca711fd837261e14ec9e674f092cbb931d3fa1482b017ae59328ddc6f3212b"
dependencies = [
"libc",
]
[[package]]
name = "libc"
-version = "0.2.98"
+version = "0.2.99"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
+checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765"
dependencies = [
"rustc-std-workspace-core",
]
}
ast::ItemKind::Fn(..) => {
- if self.sess.contains_name(&i.attrs[..], sym::plugin_registrar) {
- gate_feature_post!(
- &self,
- plugin_registrar,
- i.span,
- "compiler plugins are experimental and possibly buggy"
- );
- }
if self.sess.contains_name(&i.attrs[..], sym::start) {
gate_feature_post!(
&self,
};
ret.write_cvalue(fx, CValue::by_val(is_eq_value, ret.layout()));
};
+
+ black_box, (c a) {
+ // FIXME implement black_box semantics
+ ret.write_cvalue(fx, a);
+ };
}
if let Some((_, dest)) = destination {
}
}
-fn inline_asm_call(
+pub(crate) fn inline_asm_call(
bx: &mut Builder<'a, 'll, 'tcx>,
asm: &str,
cons: &str,
use rustc_span::symbol::Symbol;
use rustc_target::abi::{HasDataLayout, LayoutOf, PointeeInfo, Size, TargetDataLayout, VariantIdx};
use rustc_target::spec::{HasTargetSpec, RelocModel, Target, TlsModel};
+use smallvec::SmallVec;
use std::cell::{Cell, RefCell};
use std::ffi::CStr;
/// See <https://llvm.org/docs/LangRef.html#the-llvm-used-global-variable> for details
pub used_statics: RefCell<Vec<&'ll Value>>,
- pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'ll Type>>,
+ /// Mapping of non-scalar types to llvm types and field remapping if needed.
+ pub type_lowering: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), TypeLowering<'ll>>>,
+
+ /// Mapping of scalar types to llvm types.
pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'ll Type>>,
+
pub pointee_infos: RefCell<FxHashMap<(Ty<'tcx>, Size), Option<PointeeInfo>>>,
pub isize_ty: &'ll Type,
local_gen_sym_counter: Cell<usize>,
}
+pub struct TypeLowering<'ll> {
+ /// Associated LLVM type
+ pub lltype: &'ll Type,
+
+ /// If padding is used the slice maps fields from source order
+ /// to llvm order.
+ pub field_remapping: Option<SmallVec<[u32; 4]>>,
+}
+
fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {
match tls_model {
TlsModel::GeneralDynamic => llvm::ThreadLocalMode::GeneralDynamic,
const_globals: Default::default(),
statics_to_rauw: RefCell::new(Vec::new()),
used_statics: RefCell::new(Vec::new()),
- lltypes: Default::default(),
+ type_lowering: Default::default(),
scalar_lltypes: Default::default(),
pointee_infos: Default::default(),
isize_ty,
use crate::va_arg::emit_va_arg;
use crate::value::Value;
+use rustc_ast as ast;
use rustc_codegen_ssa::base::{compare_simd_types, wants_msvc_seh};
use rustc_codegen_ssa::common::span_invalid_monomorphization_error;
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
}
}
+ sym::black_box => {
+ args[0].val.store(self, result);
+
+ // We need to "use" the argument in some way LLVM can't introspect, and on
+ // targets that support it we can typically leverage inline assembly to do
+ // this. LLVM's interpretation of inline assembly is that it's, well, a black
+ // box. This isn't the greatest implementation since it probably deoptimizes
+ // more than we want, but it's so far good enough.
+ crate::asm::inline_asm_call(
+ self,
+ "",
+ "r,~{memory}",
+ &[result.llval],
+ self.type_void(),
+ true,
+ false,
+ ast::LlvmAsmDialect::Att,
+ &[span],
+ )
+ .unwrap_or_else(|| bug!("failed to generate inline asm call for `black_box`"));
+
+ // We have copied the value to `result` already.
+ return;
+ }
+
_ if name_str.starts_with("simd_") => {
match generic_simd_intrinsic(self, name, callee_ty, args, ret_ty, llret_ty, span) {
Ok(llval) => llval,
layout.is_llvm_scalar_pair()
}
fn backend_field_index(&self, layout: TyAndLayout<'tcx>, index: usize) -> u64 {
- layout.llvm_field_index(index)
+ layout.llvm_field_index(self, index)
}
fn scalar_pair_element_backend_type(
&self,
use crate::abi::FnAbi;
use crate::common::*;
+use crate::context::TypeLowering;
use crate::type_::Type;
use rustc_codegen_ssa::traits::*;
use rustc_middle::bug;
use rustc_target::abi::{Abi, AddressSpace, Align, FieldsShape};
use rustc_target::abi::{Int, Pointer, F32, F64};
use rustc_target::abi::{LayoutOf, PointeeInfo, Scalar, Size, TyAndLayoutMethods, Variants};
+use smallvec::{smallvec, SmallVec};
use tracing::debug;
use std::fmt::Write;
cx: &CodegenCx<'a, 'tcx>,
layout: TyAndLayout<'tcx>,
defer: &mut Option<(&'a Type, TyAndLayout<'tcx>)>,
+ field_remapping: &mut Option<SmallVec<[u32; 4]>>,
) -> &'a Type {
match layout.abi {
Abi::Scalar(_) => bug!("handled elsewhere"),
FieldsShape::Array { count, .. } => cx.type_array(layout.field(cx, 0).llvm_type(cx), count),
FieldsShape::Arbitrary { .. } => match name {
None => {
- let (llfields, packed) = struct_llfields(cx, layout);
+ let (llfields, packed, new_field_remapping) = struct_llfields(cx, layout);
+ *field_remapping = new_field_remapping;
cx.type_struct(&llfields, packed)
}
Some(ref name) => {
fn struct_llfields<'a, 'tcx>(
cx: &CodegenCx<'a, 'tcx>,
layout: TyAndLayout<'tcx>,
-) -> (Vec<&'a Type>, bool) {
+) -> (Vec<&'a Type>, bool, Option<SmallVec<[u32; 4]>>) {
debug!("struct_llfields: {:#?}", layout);
let field_count = layout.fields.count();
let mut offset = Size::ZERO;
let mut prev_effective_align = layout.align.abi;
let mut result: Vec<_> = Vec::with_capacity(1 + field_count * 2);
+ let mut field_remapping = smallvec![0; field_count];
for i in layout.fields.index_by_increasing_offset() {
let target_offset = layout.fields.offset(i as usize);
let field = layout.field(cx, i);
);
assert!(target_offset >= offset);
let padding = target_offset - offset;
- let padding_align = prev_effective_align.min(effective_field_align);
- assert_eq!(offset.align_to(padding_align) + padding, target_offset);
- result.push(cx.type_padding_filler(padding, padding_align));
- debug!(" padding before: {:?}", padding);
-
+ if padding != Size::ZERO {
+ let padding_align = prev_effective_align.min(effective_field_align);
+ assert_eq!(offset.align_to(padding_align) + padding, target_offset);
+ result.push(cx.type_padding_filler(padding, padding_align));
+ debug!(" padding before: {:?}", padding);
+ }
+ field_remapping[i] = result.len() as u32;
result.push(field.llvm_type(cx));
offset = target_offset + field.size;
prev_effective_align = effective_field_align;
}
+ let padding_used = result.len() > field_count;
if !layout.is_unsized() && field_count > 0 {
if offset > layout.size {
bug!("layout: {:#?} stride: {:?} offset: {:?}", layout, layout.size, offset);
}
let padding = layout.size - offset;
- let padding_align = prev_effective_align;
- assert_eq!(offset.align_to(padding_align) + padding, layout.size);
- debug!(
- "struct_llfields: pad_bytes: {:?} offset: {:?} stride: {:?}",
- padding, offset, layout.size
- );
- result.push(cx.type_padding_filler(padding, padding_align));
- assert_eq!(result.len(), 1 + field_count * 2);
+ if padding != Size::ZERO {
+ let padding_align = prev_effective_align;
+ assert_eq!(offset.align_to(padding_align) + padding, layout.size);
+ debug!(
+ "struct_llfields: pad_bytes: {:?} offset: {:?} stride: {:?}",
+ padding, offset, layout.size
+ );
+ result.push(cx.type_padding_filler(padding, padding_align));
+ }
} else {
debug!("struct_llfields: offset: {:?} stride: {:?}", offset, layout.size);
}
-
- (result, packed)
+ let field_remapping = if padding_used { Some(field_remapping) } else { None };
+ (result, packed, field_remapping)
}
impl<'a, 'tcx> CodegenCx<'a, 'tcx> {
index: usize,
immediate: bool,
) -> &'a Type;
- fn llvm_field_index(&self, index: usize) -> u64;
+ fn llvm_field_index<'a>(&self, cx: &CodegenCx<'a, 'tcx>, index: usize) -> u64;
fn pointee_info_at<'a>(&self, cx: &CodegenCx<'a, 'tcx>, offset: Size) -> Option<PointeeInfo>;
}
Variants::Single { index } => Some(index),
_ => None,
};
- if let Some(&llty) = cx.lltypes.borrow().get(&(self.ty, variant_index)) {
- return llty;
+ if let Some(ref llty) = cx.type_lowering.borrow().get(&(self.ty, variant_index)) {
+ return llty.lltype;
}
debug!("llvm_type({:#?})", self);
let normal_ty = cx.tcx.erase_regions(self.ty);
let mut defer = None;
+ let mut field_remapping = None;
let llty = if self.ty != normal_ty {
let mut layout = cx.layout_of(normal_ty);
if let Some(v) = variant_index {
}
layout.llvm_type(cx)
} else {
- uncached_llvm_type(cx, *self, &mut defer)
+ uncached_llvm_type(cx, *self, &mut defer, &mut field_remapping)
};
debug!("--> mapped {:#?} to llty={:?}", self, llty);
- cx.lltypes.borrow_mut().insert((self.ty, variant_index), llty);
+ cx.type_lowering.borrow_mut().insert(
+ (self.ty, variant_index),
+ TypeLowering { lltype: llty, field_remapping: field_remapping },
+ );
if let Some((llty, layout)) = defer {
- let (llfields, packed) = struct_llfields(cx, layout);
- cx.set_struct_body(llty, &llfields, packed)
+ let (llfields, packed, new_field_remapping) = struct_llfields(cx, layout);
+ cx.set_struct_body(llty, &llfields, packed);
+ cx.type_lowering
+ .borrow_mut()
+ .get_mut(&(self.ty, variant_index))
+ .unwrap()
+ .field_remapping = new_field_remapping;
}
-
llty
}
self.scalar_llvm_type_at(cx, scalar, offset)
}
- fn llvm_field_index(&self, index: usize) -> u64 {
+ fn llvm_field_index<'a>(&self, cx: &CodegenCx<'a, 'tcx>, index: usize) -> u64 {
match self.abi {
Abi::Scalar(_) | Abi::ScalarPair(..) => {
bug!("TyAndLayout::llvm_field_index({:?}): not applicable", self)
FieldsShape::Array { .. } => index as u64,
- FieldsShape::Arbitrary { .. } => 1 + (self.fields.memory_index(index) as u64) * 2,
+ FieldsShape::Arbitrary { .. } => {
+ let variant_index = match self.variants {
+ Variants::Single { index } => Some(index),
+ _ => None,
+ };
+
+ // Look up llvm field if indexes do not match memory order due to padding. If
+ // `field_remapping` is `None` no padding was used and the llvm field index
+ // matches the memory index.
+ match cx.type_lowering.borrow().get(&(self.ty, variant_index)) {
+ Some(TypeLowering { field_remapping: Some(ref remap), .. }) => {
+ remap[index] as u64
+ }
+ Some(_) => self.fields.memory_index(index) as u64,
+ None => {
+ bug!("TyAndLayout::llvm_field_index({:?}): type info not found", self)
+ }
+ }
+ }
}
}
// Implementation of the AAPCS64 calling convention for va_args see
// https://github.com/ARM-software/abi-aa/blob/master/aapcs64/aapcs64.rst
let va_list_addr = list.immediate();
- let va_list_ty = list.deref(bx.cx).layout.llvm_type(bx);
+ let va_list_layout = list.deref(bx.cx).layout;
+ let va_list_ty = va_list_layout.llvm_type(bx);
let layout = bx.cx.layout_of(target_ty);
let mut maybe_reg = bx.build_sibling_block("va_arg.maybe_reg");
let gr_type = target_ty.is_any_ptr() || target_ty.is_integral();
let (reg_off, reg_top_index, slot_size) = if gr_type {
- let gr_offs = bx.struct_gep(va_list_ty, va_list_addr, 7);
+ let gr_offs =
+ bx.struct_gep(va_list_ty, va_list_addr, va_list_layout.llvm_field_index(bx.cx, 3));
let nreg = (layout.size.bytes() + 7) / 8;
- (gr_offs, 3, nreg * 8)
+ (gr_offs, va_list_layout.llvm_field_index(bx.cx, 1), nreg * 8)
} else {
- let vr_off = bx.struct_gep(va_list_ty, va_list_addr, 9);
+ let vr_off =
+ bx.struct_gep(va_list_ty, va_list_addr, va_list_layout.llvm_field_index(bx.cx, 4));
let nreg = (layout.size.bytes() + 15) / 16;
- (vr_off, 5, nreg * 16)
+ (vr_off, va_list_layout.llvm_field_index(bx.cx, 2), nreg * 16)
};
// if the offset >= 0 then the value will be on the stack
reachable_non_generics.insert(id.to_def_id(), SymbolExportLevel::C);
}
- if let Some(id) = tcx.plugin_registrar_fn(()) {
- reachable_non_generics.insert(id.to_def_id(), SymbolExportLevel::C);
- }
-
reachable_non_generics
}
}
pub trait ControlFlowGraph:
- DirectedGraph + WithStartNode + WithPredecessors + WithStartNode + WithSuccessors + WithNumNodes
+ DirectedGraph + WithStartNode + WithPredecessors + WithSuccessors + WithNumNodes
{
// convenient trait
}
impl<T> ControlFlowGraph for T where
- T: DirectedGraph
- + WithStartNode
- + WithPredecessors
- + WithStartNode
- + WithSuccessors
- + WithNumNodes
+ T: DirectedGraph + WithStartNode + WithPredecessors + WithSuccessors + WithNumNodes
{
}
.with_indent_lines(true)
.with_ansi(color_logs)
.with_targets(true)
- .with_wraparound(10)
- .with_verbose_exit(true)
- .with_verbose_entry(true)
.with_indent_amount(2);
#[cfg(parallel_compiler)]
let layer = layer.with_thread_ids(true).with_thread_names(true);
A binding shadowed something it shouldn't.
-Erroneous code example:
+A match arm or a variable has a name that is already used by
+something else, e.g.
+
+* struct name
+* enum variant
+* static
+* associated constant
+
+This error may also happen when an enum variant *with fields* is used
+in a pattern, but without its fields.
+
+```compile_fail
+enum Enum {
+ WithField(i32)
+}
+
+use Enum::*;
+match WithField(1) {
+ WithField => {} // error: missing (_)
+}
+```
+
+Match bindings cannot shadow statics:
```compile_fail,E0530
static TEST: i32 = 0;
-let r: (i32, i32) = (0, 0);
+let r = 123;
match r {
- TEST => {} // error: match bindings cannot shadow statics
+ TEST => {} // error: name of a static
}
```
-To fix this error, just change the binding's name in order to avoid shadowing
-one of the following:
+Fixed examples:
-* struct name
-* struct/enum variant
-* static
-* const
-* associated const
+```
+static TEST: i32 = 0;
-Fixed example:
+let r = 123;
+match r {
+ some_value => {} // ok!
+}
+```
+
+or
```
-static TEST: i32 = 0;
+const TEST: i32 = 0; // const, not static
-let r: (i32, i32) = (0, 0);
+let r = 123;
match r {
- something => {} // ok!
+ TEST => {} // const is ok!
+ other_values => {}
}
```
use crate::snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, Style, StyledString};
use crate::styled_buffer::StyledBuffer;
-use crate::{CodeSuggestion, Diagnostic, DiagnosticId, Level, SubDiagnostic, SuggestionStyle};
+use crate::{
+ CodeSuggestion, Diagnostic, DiagnosticId, Level, SubDiagnostic, SubstitutionHighlight,
+ SuggestionStyle,
+};
use rustc_lint_defs::pluralize;
);
let mut row_num = 2;
+ draw_col_separator_no_space(&mut buffer, 1, max_line_num_len + 1);
let mut notice_capitalization = false;
- for (complete, parts, only_capitalization) in suggestions.iter().take(MAX_SUGGESTIONS) {
+ for (complete, parts, highlights, only_capitalization) in
+ suggestions.iter().take(MAX_SUGGESTIONS)
+ {
notice_capitalization |= only_capitalization;
// Only show underline if the suggestion spans a single line and doesn't cover the
// entirety of the code output. If you have multiple replacements in the same line
let show_underline = !(parts.len() == 1 && parts[0].snippet.trim() == complete.trim())
&& complete.lines().count() == 1;
- let lines = sm
+ let has_deletion = parts.iter().any(|p| p.is_deletion());
+ let is_multiline = complete.lines().count() > 1;
+
+ let show_diff = has_deletion && !is_multiline;
+
+ if show_diff {
+ row_num += 1;
+ }
+
+ let file_lines = sm
.span_to_lines(parts[0].span)
.expect("span_to_lines failed when emitting suggestion");
- assert!(!lines.lines.is_empty() || parts[0].span.is_dummy());
+ assert!(!file_lines.lines.is_empty() || parts[0].span.is_dummy());
let line_start = sm.lookup_char_pos(parts[0].span.lo()).line;
draw_col_separator_no_space(&mut buffer, 1, max_line_num_len + 1);
let mut lines = complete.lines();
- for (line_pos, line) in lines.by_ref().take(MAX_SUGGESTION_HIGHLIGHT_LINES).enumerate()
+ for (line_pos, (line, parts)) in
+ lines.by_ref().zip(highlights).take(MAX_SUGGESTION_HIGHLIGHT_LINES).enumerate()
{
// Print the span column to avoid confusion
buffer.puts(
&self.maybe_anonymized(line_start + line_pos),
Style::LineNumber,
);
+ if show_diff {
+ // Add the line number for both addition and removal to drive the point home.
+ //
+ // N - fn foo<A: T>(bar: A) {
+ // N + fn foo(bar: impl T) {
+ buffer.puts(
+ row_num - 1,
+ 0,
+ &self.maybe_anonymized(line_start + line_pos),
+ Style::LineNumber,
+ );
+ buffer.puts(row_num - 1, max_line_num_len + 1, "- ", Style::Removal);
+ buffer.puts(
+ row_num - 1,
+ max_line_num_len + 3,
+ &replace_tabs(
+ &*file_lines
+ .file
+ .get_line(file_lines.lines[line_pos].line_index)
+ .unwrap(),
+ ),
+ Style::NoStyle,
+ );
+ buffer.puts(row_num, max_line_num_len + 1, "+ ", Style::Addition);
+ } else if is_multiline {
+ match &parts[..] {
+ [SubstitutionHighlight { start: 0, end }] if *end == line.len() => {
+ buffer.puts(row_num, max_line_num_len + 1, "+ ", Style::Addition);
+ }
+ [] => {
+ draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
+ }
+ _ => {
+ buffer.puts(row_num, max_line_num_len + 1, "~ ", Style::Addition);
+ }
+ }
+ } else {
+ draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
+ }
+
// print the suggestion
- draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
buffer.append(row_num, &replace_tabs(line), Style::NoStyle);
+
+ if is_multiline {
+ for SubstitutionHighlight { start, end } in parts {
+ buffer.set_style_range(
+ row_num,
+ max_line_num_len + 3 + start,
+ max_line_num_len + 3 + end,
+ Style::Addition,
+ true,
+ );
+ }
+ }
row_num += 1;
}
let underline_start = (span_start_pos + start) as isize + offset;
let underline_end = (span_start_pos + start + sub_len) as isize + offset;
assert!(underline_start >= 0 && underline_end >= 0);
+ let padding: usize = max_line_num_len + 3;
for p in underline_start..underline_end {
- buffer.putc(
- row_num,
- ((max_line_num_len + 3) as isize + p) as usize,
- '^',
- Style::UnderlinePrimary,
+ // Colorize addition/replacements with green.
+ buffer.set_style(
+ row_num - 1,
+ (padding as isize + p) as usize,
+ Style::Addition,
+ true,
);
- }
- // underline removals too
- if underline_start == underline_end {
- for p in underline_start - 1..underline_start + 1 {
+ if !show_diff {
+ // If this is a replacement, underline with `^`, if this is an addition
+ // underline with `+`.
buffer.putc(
row_num,
- ((max_line_num_len + 3) as isize + p) as usize,
- '-',
- Style::UnderlineSecondary,
+ (padding as isize + p) as usize,
+ if part.is_addition(&sm) { '+' } else { '~' },
+ Style::Addition,
);
}
}
+ if show_diff {
+ // Colorize removal with red in diff format.
+ buffer.set_style_range(
+ row_num - 2,
+ (padding as isize + span_start_pos as isize) as usize,
+ (padding as isize + span_end_pos as isize) as usize,
+ Style::Removal,
+ true,
+ );
+ }
// length of the code after substitution
let full_sub_len = part
fn apply_style(&mut self, lvl: Level, style: Style) -> io::Result<()> {
let mut spec = ColorSpec::new();
match style {
+ Style::Addition => {
+ spec.set_fg(Some(Color::Green)).set_intense(true);
+ }
+ Style::Removal => {
+ spec.set_fg(Some(Color::Red)).set_intense(true);
+ }
Style::LineAndColumn => {}
Style::LineNumber => {
spec.set_bold(true);
pub snippet: String,
}
+/// Used to translate between `Span`s and byte positions within a single output line in highlighted
+/// code of structured suggestions.
+#[derive(Debug, Clone, Copy)]
+pub struct SubstitutionHighlight {
+ start: usize,
+ end: usize,
+}
+
+impl SubstitutionPart {
+ pub fn is_addition(&self, sm: &SourceMap) -> bool {
+ !self.snippet.is_empty()
+ && sm
+ .span_to_snippet(self.span)
+ .map_or(self.span.is_empty(), |snippet| snippet.trim().is_empty())
+ }
+
+ pub fn is_deletion(&self) -> bool {
+ self.snippet.trim().is_empty()
+ }
+
+ pub fn is_replacement(&self, sm: &SourceMap) -> bool {
+ !self.snippet.is_empty()
+ && sm
+ .span_to_snippet(self.span)
+ .map_or(!self.span.is_empty(), |snippet| !snippet.trim().is_empty())
+ }
+}
+
impl CodeSuggestion {
/// Returns the assembled code suggestions, whether they should be shown with an underline
/// and whether the substitution only differs in capitalization.
- pub fn splice_lines(&self, sm: &SourceMap) -> Vec<(String, Vec<SubstitutionPart>, bool)> {
+ pub fn splice_lines(
+ &self,
+ sm: &SourceMap,
+ ) -> Vec<(String, Vec<SubstitutionPart>, Vec<Vec<SubstitutionHighlight>>, bool)> {
+ // For the `Vec<Vec<SubstitutionHighlight>>` value, the first level of the vector
+ // corresponds to the output snippet's lines, while the second level corresponds to the
+ // substrings within that line that should be highlighted.
+
use rustc_span::{CharPos, Pos};
+ /// Append to a buffer the remainder of the line of existing source code, and return the
+ /// count of lines that have been added for accurate highlighting.
fn push_trailing(
buf: &mut String,
line_opt: Option<&Cow<'_, str>>,
lo: &Loc,
hi_opt: Option<&Loc>,
- ) {
+ ) -> usize {
+ let mut line_count = 0;
let (lo, hi_opt) = (lo.col.to_usize(), hi_opt.map(|hi| hi.col.to_usize()));
if let Some(line) = line_opt {
if let Some(lo) = line.char_indices().map(|(i, _)| i).nth(lo) {
let hi_opt = hi_opt.and_then(|hi| line.char_indices().map(|(i, _)| i).nth(hi));
match hi_opt {
- Some(hi) if hi > lo => buf.push_str(&line[lo..hi]),
+ Some(hi) if hi > lo => {
+ line_count = line[lo..hi].matches('\n').count();
+ buf.push_str(&line[lo..hi])
+ }
Some(_) => (),
- None => buf.push_str(&line[lo..]),
+ None => {
+ line_count = line[lo..].matches('\n').count();
+ buf.push_str(&line[lo..])
+ }
}
}
if hi_opt.is_none() {
buf.push('\n');
}
}
+ line_count
}
assert!(!self.substitutions.is_empty());
return None;
}
+ let mut highlights = vec![];
// To build up the result, we do this for each span:
// - push the line segment trailing the previous span
// (at the beginning a "phantom" span pointing at the start of the line)
lines.lines.get(0).and_then(|line0| sf.get_line(line0.line_index));
let mut buf = String::new();
+ let mut line_highlight = vec![];
for part in &substitution.parts {
let cur_lo = sm.lookup_char_pos(part.span.lo());
if prev_hi.line == cur_lo.line {
- push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, Some(&cur_lo));
+ let mut count =
+ push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, Some(&cur_lo));
+ while count > 0 {
+ highlights.push(std::mem::take(&mut line_highlight));
+ count -= 1;
+ }
} else {
- push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, None);
+ highlights.push(std::mem::take(&mut line_highlight));
+ let mut count = push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, None);
+ while count > 0 {
+ highlights.push(std::mem::take(&mut line_highlight));
+ count -= 1;
+ }
// push lines between the previous and current span (if any)
for idx in prev_hi.line..(cur_lo.line - 1) {
if let Some(line) = sf.get_line(idx) {
buf.push_str(line.as_ref());
buf.push('\n');
+ highlights.push(std::mem::take(&mut line_highlight));
}
}
if let Some(cur_line) = sf.get_line(cur_lo.line - 1) {
buf.push_str(&cur_line[..end]);
}
}
+ // Add a whole line highlight per line in the snippet.
+ line_highlight.push(SubstitutionHighlight {
+ start: cur_lo.col.0,
+ end: cur_lo.col.0
+ + part.snippet.split('\n').next().unwrap_or(&part.snippet).len(),
+ });
+ for line in part.snippet.split('\n').skip(1) {
+ highlights.push(std::mem::take(&mut line_highlight));
+ line_highlight.push(SubstitutionHighlight { start: 0, end: line.len() });
+ }
buf.push_str(&part.snippet);
prev_hi = sm.lookup_char_pos(part.span.hi());
prev_line = sf.get_line(prev_hi.line - 1);
}
+ highlights.push(std::mem::take(&mut line_highlight));
let only_capitalization = is_case_difference(sm, &buf, bounding_span);
// if the replacement already ends with a newline, don't print the next line
if !buf.ends_with('\n') {
while buf.ends_with('\n') {
buf.pop();
}
- Some((buf, substitution.parts, only_capitalization))
+ Some((buf, substitution.parts, highlights, only_capitalization))
})
.collect()
}
NoStyle,
Level(Level),
Highlight,
+ Addition,
+ Removal,
}
// feature-group-start: actual feature gates
// -------------------------------------------------------------------------
- /// Allows using `#[plugin_registrar]` on functions.
- (active, plugin_registrar, "1.0.0", Some(29597), None),
-
/// Allows using `#![plugin(myplugin)]`.
(active, plugin, "1.0.0", Some(29597), None),
),
// Plugins:
- (
- sym::plugin_registrar, Normal, template!(Word),
- Gated(
- Stability::Deprecated(
- "https://github.com/rust-lang/rust/pull/64675",
- Some("may be removed in a future compiler version"),
- ),
- sym::plugin_registrar,
- "compiler plugins are deprecated",
- cfg_fn!(plugin_registrar)
- )
- ),
(
sym::plugin, CrateLevel, template!(List: "name"),
Gated(
(removed, main, "1.53.0", Some(29634), None, None),
(removed, pub_macro_rules, "1.53.0", Some(78855), None,
Some("removed due to being incomplete, in particular it does not work across crates")),
- /// Allows the definition of `const` functions with some advanced features.
+ /// Allows the definition of `const` functions with some advanced features.
(removed, const_fn, "1.54.0", Some(57563), None,
Some("split into finer-grained feature gates")),
+ /// Allows using `#[plugin_registrar]` on functions.
+ (removed, plugin_registrar, "1.54.0", Some(29597), None,
+ Some("a __rustc_plugin_registrar symbol must now be defined instead")),
/// Allows `#[doc(include = "some-file")]`.
(removed, external_doc, "1.54.0", Some(44732), None,
pub use self::SubregionOrigin::*;
pub use self::ValuePairs::*;
+use self::opaque_types::OpaqueTypeMap;
pub(crate) use self::undo_log::{InferCtxtUndoLogs, Snapshot, UndoLog};
use crate::traits::{self, ObligationCause, PredicateObligations, TraitEngine};
+use hir::def_id::CRATE_DEF_ID;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::undo_log::Rollback;
mod lexical_region_resolve;
mod lub;
pub mod nll_relate;
+pub mod opaque_types;
pub mod outlives;
pub mod region_constraints;
pub mod resolve;
region_obligations: Vec<(hir::HirId, RegionObligation<'tcx>)>,
undo_log: InferCtxtUndoLogs<'tcx>,
+
+ // Opaque types found in explicit return types and their
+ // associated fresh inference variable. Writeback resolves these
+ // variables to get the concrete type, which can be used to
+ // 'de-opaque' OpaqueTypeDecl, after typeck is done with all functions.
+ pub opaque_types: OpaqueTypeMap<'tcx>,
+
+ /// A map from inference variables created from opaque
+ /// type instantiations (`ty::Infer`) to the actual opaque
+ /// type (`ty::Opaque`). Used during fallback to map unconstrained
+ /// opaque type inference variables to their corresponding
+ /// opaque type.
+ pub opaque_types_vars: FxHashMap<Ty<'tcx>, Ty<'tcx>>,
}
impl<'tcx> InferCtxtInner<'tcx> {
float_unification_storage: ut::UnificationTableStorage::new(),
region_constraint_storage: Some(RegionConstraintStorage::new()),
region_obligations: vec![],
+ opaque_types: Default::default(),
+ opaque_types_vars: Default::default(),
}
}
pub struct InferCtxt<'a, 'tcx> {
pub tcx: TyCtxt<'tcx>,
+ /// The `DefId` of the item in whose context we are performing inference or typeck.
+ /// It is used to check whether an opaque type use is a defining use.
+ pub defining_use_anchor: LocalDefId,
+
/// During type-checking/inference of a body, `in_progress_typeck_results`
/// contains a reference to the typeck results being built up, which are
/// used for reading closure kinds/signatures as they are inferred,
pub struct InferCtxtBuilder<'tcx> {
tcx: TyCtxt<'tcx>,
fresh_typeck_results: Option<RefCell<ty::TypeckResults<'tcx>>>,
+ defining_use_anchor: LocalDefId,
}
pub trait TyCtxtInferExt<'tcx> {
impl TyCtxtInferExt<'tcx> for TyCtxt<'tcx> {
fn infer_ctxt(self) -> InferCtxtBuilder<'tcx> {
- InferCtxtBuilder { tcx: self, fresh_typeck_results: None }
+ InferCtxtBuilder {
+ tcx: self,
+ defining_use_anchor: CRATE_DEF_ID,
+ fresh_typeck_results: None,
+ }
}
}
impl<'tcx> InferCtxtBuilder<'tcx> {
/// Used only by `rustc_typeck` during body type-checking/inference,
/// will initialize `in_progress_typeck_results` with fresh `TypeckResults`.
+ /// Will also change the scope for opaque type defining use checks to the given owner.
pub fn with_fresh_in_progress_typeck_results(mut self, table_owner: LocalDefId) -> Self {
self.fresh_typeck_results = Some(RefCell::new(ty::TypeckResults::new(table_owner)));
+ self.with_opaque_type_inference(table_owner)
+ }
+
+ /// Whenever the `InferCtxt` should be able to handle defining uses of opaque types,
+ /// you need to call this function. Otherwise the opaque type will be treated opaquely.
+ ///
+ /// It is only meant to be called in two places, for typeck
+ /// (via `with_fresh_in_progress_typeck_results`) and for the inference context used
+ /// in mir borrowck.
+ pub fn with_opaque_type_inference(mut self, defining_use_anchor: LocalDefId) -> Self {
+ self.defining_use_anchor = defining_use_anchor;
self
}
}
pub fn enter<R>(&mut self, f: impl for<'a> FnOnce(InferCtxt<'a, 'tcx>) -> R) -> R {
- let InferCtxtBuilder { tcx, ref fresh_typeck_results } = *self;
+ let InferCtxtBuilder { tcx, defining_use_anchor, ref fresh_typeck_results } = *self;
let in_progress_typeck_results = fresh_typeck_results.as_ref();
f(InferCtxt {
tcx,
+ defining_use_anchor,
in_progress_typeck_results,
inner: RefCell::new(InferCtxtInner::new()),
lexical_region_resolutions: RefCell::new(None),
--- /dev/null
+use rustc_data_structures::vec_map::VecMap;
+use rustc_hir as hir;
+use rustc_middle::ty::{OpaqueTypeKey, Ty};
+use rustc_span::Span;
+
+pub type OpaqueTypeMap<'tcx> = VecMap<OpaqueTypeKey<'tcx>, OpaqueTypeDecl<'tcx>>;
+
+/// Information about the opaque types whose values we
+/// are inferring in this function (these are the `impl Trait` that
+/// appear in the return type).
+#[derive(Copy, Clone, Debug)]
+pub struct OpaqueTypeDecl<'tcx> {
+ /// The opaque type (`ty::Opaque`) for this declaration.
+ pub opaque_type: Ty<'tcx>,
+
+ /// The span of this particular definition of the opaque type. So
+ /// for example:
+ ///
+ /// ```ignore (incomplete snippet)
+ /// type Foo = impl Baz;
+ /// fn bar() -> Foo {
+ /// // ^^^ This is the span we are looking for!
+ /// }
+ /// ```
+ ///
+ /// In cases where the fn returns `(impl Trait, impl Trait)` or
+ /// other such combinations, the result is currently
+ /// over-approximated, but better than nothing.
+ pub definition_span: Span,
+
+ /// The type variable that represents the value of the opaque type
+ /// that we require. In other words, after we compile this function,
+ /// we will be created a constraint like:
+ ///
+ /// Foo<'a, T> = ?C
+ ///
+ /// where `?C` is the value of this type variable. =) It may
+ /// naturally refer to the type and lifetime parameters in scope
+ /// in this function, though ultimately it should only reference
+ /// those that are arguments to `Foo` in the constraint above. (In
+ /// other words, `?C` should not include `'b`, even though it's a
+ /// lifetime parameter on `foo`.)
+ pub concrete_ty: Ty<'tcx>,
+
+ /// The origin of the opaque type.
+ pub origin: hir::OpaqueTyOrigin,
+}
let providers = &mut Providers::default();
providers.analysis = analysis;
proc_macro_decls::provide(providers);
- plugin::build::provide(providers);
rustc_middle::hir::provide(providers);
mir::provide(providers);
mir_build::provide(providers);
{
entry_point = sess.time("looking_for_entry_point", || tcx.entry_fn(()));
- sess.time("looking_for_plugin_registrar", || tcx.ensure().plugin_registrar_fn(()));
-
sess.time("looking_for_derive_registrar", || {
tcx.ensure().proc_macro_decls_static(())
});
/// After a line ending with '\', the next line contains whitespace
/// characters that are not skipped.
UnskippedWhitespaceWarning,
+
+ /// After a line ending with '\', multiple lines are skipped.
+ MultipleSkippedLinesWarning,
}
impl EscapeError {
pub fn is_fatal(&self) -> bool {
match self {
EscapeError::UnskippedWhitespaceWarning => false,
+ EscapeError::MultipleSkippedLinesWarning => false,
_ => true,
}
}
where
F: FnMut(Range<usize>, Result<char, EscapeError>),
{
- let str = chars.as_str();
- let first_non_space = str
+ let tail = chars.as_str();
+ let first_non_space = tail
.bytes()
.position(|b| b != b' ' && b != b'\t' && b != b'\n' && b != b'\r')
- .unwrap_or(str.len());
- let tail = &str[first_non_space..];
+ .unwrap_or(tail.len());
+ if tail[1..first_non_space].contains('\n') {
+ // The +1 accounts for the escaping slash.
+ let end = start + first_non_space + 1;
+ callback(start..end, Err(EscapeError::MultipleSkippedLinesWarning));
+ }
+ let tail = &tail[first_non_space..];
if let Some(c) = tail.chars().nth(0) {
// For error reporting, we would like the span to contain the character that was not
// skipped. The +1 is necessary to account for the leading \ that started the escape.
assert_eq!(unescaped, expected);
}
+ // Check we can handle escaped newlines at the end of a file.
+ check("\\\n", &[]);
+ check("\\\n ", &[]);
+
check(
"\\\n \u{a0} x",
&[
(6..7, Ok('x')),
],
);
+ check("\\\n \n x", &[(0..7, Err(EscapeError::MultipleSkippedLinesWarning)), (7..8, Ok('x'))]);
}
#[test]
Warn,
"detects calling `into_iter` on arrays in Rust 2015 and 2018",
@future_incompatible = FutureIncompatibleInfo {
- reference: "issue #66145 <https://github.com/rust-lang/rust/issues/66145>",
+ reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>",
reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021),
};
}
Warn,
"`...` range patterns are deprecated",
@future_incompatible = FutureIncompatibleInfo {
- reference: "issue #80165 <https://github.com/rust-lang/rust/issues/80165>",
+ reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>",
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
};
}
Warn,
"suggest using `dyn Trait` for trait objects",
@future_incompatible = FutureIncompatibleInfo {
- reference: "issue #80165 <https://github.com/rust-lang/rust/issues/80165>",
+ reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>",
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
};
}
Allow,
"detects usage of old versions of or-patterns",
@future_incompatible = FutureIncompatibleInfo {
- reference: "issue #84869 <https://github.com/rust-lang/rust/issues/84869>",
+ reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>",
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
};
}
"detects the usage of trait methods which are ambiguous with traits added to the \
prelude in future editions",
@future_incompatible = FutureIncompatibleInfo {
- reference: "issue #85684 <https://github.com/rust-lang/rust/issues/85684>",
+ reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>",
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
};
}
Allow,
"identifiers that will be parsed as a prefix in Rust 2021",
@future_incompatible = FutureIncompatibleInfo {
- reference: "issue #84978 <https://github.com/rust-lang/rust/issues/84978>",
+ reference: "<https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>",
reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021),
};
crate_level_only
use rustc_session::filesearch::{FileDoesntMatch, FileMatches, FileSearch};
use rustc_session::search_paths::PathKind;
use rustc_session::utils::CanonicalizedPath;
-use rustc_session::{Session, StableCrateId};
+use rustc_session::Session;
use rustc_span::symbol::{sym, Symbol};
use rustc_span::Span;
use rustc_target::spec::{Target, TargetTriple};
metadata_loader: &dyn MetadataLoader,
span: Span,
name: Symbol,
-) -> (PathBuf, StableCrateId) {
+) -> PathBuf {
match find_plugin_registrar_impl(sess, metadata_loader, name) {
Ok(res) => res,
// `core` is always available if we got as far as loading plugins.
sess: &'a Session,
metadata_loader: &dyn MetadataLoader,
name: Symbol,
-) -> Result<(PathBuf, StableCrateId), CrateError> {
+) -> Result<PathBuf, CrateError> {
info!("find plugin registrar `{}`", name);
let mut locator = CrateLocator::new(
sess,
match locator.maybe_load_library_crate()? {
Some(library) => match library.source.dylib {
- Some(dylib) => Ok((dylib.0, library.metadata.get_root().stable_crate_id())),
+ Some(dylib) => Ok(dylib.0),
None => Err(CrateError::NonDylibPlugin(name)),
},
None => Err(locator.into_error()),
query entry_fn(_: ()) -> Option<(DefId, EntryFnType)> {
desc { "looking up the entry function of a crate" }
}
- query plugin_registrar_fn(_: ()) -> Option<LocalDefId> {
- desc { "looking up the plugin registrar for a crate" }
- }
query proc_macro_decls_static(_: ()) -> Option<LocalDefId> {
desc { "looking up the derive registrar for a crate" }
}
let (input_body, promoted) = tcx.mir_promoted(def);
debug!("run query mir_borrowck: {}", tcx.def_path_str(def.did.to_def_id()));
- let opt_closure_req = tcx.infer_ctxt().enter(|infcx| {
+ let opt_closure_req = tcx.infer_ctxt().with_opaque_type_inference(def.did).enter(|infcx| {
let input_body: &Body<'_> = &input_body.borrow();
let promoted: &IndexVec<_, _> = &promoted.borrow();
do_mir_borrowck(&infcx, input_body, promoted)
liveness::generate(&mut cx, body, elements, flow_inits, move_data, location_table);
translate_outlives_facts(&mut cx);
- let mut opaque_type_values = cx.opaque_type_values;
-
- for (_, revealed_ty) in &mut opaque_type_values {
- *revealed_ty = infcx.resolve_vars_if_possible(*revealed_ty);
- if revealed_ty.has_infer_types_or_consts() {
- infcx.tcx.sess.delay_span_bug(
- body.span,
- &format!("could not resolve {:#?}", revealed_ty.kind()),
- );
- *revealed_ty = infcx.tcx.ty_error();
- }
- }
-
- opaque_type_values.retain(|(opaque_type_key, resolved_ty)| {
- let concrete_is_opaque = if let ty::Opaque(def_id, _) = resolved_ty.kind() {
- *def_id == opaque_type_key.def_id
- } else {
- false
- };
+ let opaque_type_values = mem::take(&mut infcx.inner.borrow_mut().opaque_types);
- if concrete_is_opaque {
- // We're using an opaque `impl Trait` type without
- // 'revealing' it. For example, code like this:
- //
- // type Foo = impl Debug;
- // fn foo1() -> Foo { ... }
- // fn foo2() -> Foo { foo1() }
- //
- // In `foo2`, we're not revealing the type of `Foo` - we're
- // just treating it as the opaque type.
- //
- // When this occurs, we do *not* want to try to equate
- // the concrete type with the underlying defining type
- // of the opaque type - this will always fail, since
- // the defining type of an opaque type is always
- // some other type (e.g. not itself)
- // Essentially, none of the normal obligations apply here -
- // we're just passing around some unknown opaque type,
- // without actually looking at the underlying type it
- // gets 'revealed' into
- debug!(
- "eq_opaque_type_and_type: non-defining use of {:?}",
- opaque_type_key.def_id,
- );
- }
- !concrete_is_opaque
- });
opaque_type_values
+ .into_iter()
+ .filter_map(|(opaque_type_key, decl)| {
+ let mut revealed_ty = infcx.resolve_vars_if_possible(decl.concrete_ty);
+ if revealed_ty.has_infer_types_or_consts() {
+ infcx.tcx.sess.delay_span_bug(
+ body.span,
+ &format!("could not resolve {:#?}", revealed_ty.kind()),
+ );
+ revealed_ty = infcx.tcx.ty_error();
+ }
+ let concrete_is_opaque = if let ty::Opaque(def_id, _) = revealed_ty.kind() {
+ *def_id == opaque_type_key.def_id
+ } else {
+ false
+ };
+
+ if concrete_is_opaque {
+ // We're using an opaque `impl Trait` type without
+ // 'revealing' it. For example, code like this:
+ //
+ // type Foo = impl Debug;
+ // fn foo1() -> Foo { ... }
+ // fn foo2() -> Foo { foo1() }
+ //
+ // In `foo2`, we're not revealing the type of `Foo` - we're
+ // just treating it as the opaque type.
+ //
+ // When this occurs, we do *not* want to try to equate
+ // the concrete type with the underlying defining type
+ // of the opaque type - this will always fail, since
+ // the defining type of an opaque type is always
+ // some other type (e.g. not itself)
+ // Essentially, none of the normal obligations apply here -
+ // we're just passing around some unknown opaque type,
+ // without actually looking at the underlying type it
+ // gets 'revealed' into
+ debug!(
+ "eq_opaque_type_and_type: non-defining use of {:?}",
+ opaque_type_key.def_id,
+ );
+ None
+ } else {
+ Some((opaque_type_key, revealed_ty))
+ }
+ })
+ .collect()
},
);
reported_errors: FxHashSet<(Ty<'tcx>, Span)>,
borrowck_context: &'a mut BorrowCheckContext<'a, 'tcx>,
universal_region_relations: &'a UniversalRegionRelations<'tcx>,
- opaque_type_values: VecMap<OpaqueTypeKey<'tcx>, Ty<'tcx>>,
}
struct BorrowCheckContext<'a, 'tcx> {
borrowck_context,
reported_errors: Default::default(),
universal_region_relations,
- opaque_type_values: VecMap::default(),
};
checker.check_user_type_annotations();
checker
let body = self.body;
let mir_def_id = body.source.def_id().expect_local();
- let mut opaque_type_values = VecMap::new();
-
debug!("eq_opaque_type_and_type: mir_def_id={:?}", mir_def_id);
- let opaque_type_map = self.fully_perform_op(
+ self.fully_perform_op(
locations,
category,
CustomTypeOp::new(
// to `Box<?T>`, returning an `opaque_type_map` mapping `{Foo<T> -> ?T}`.
// (Note that the key of the map is both the def-id of `Foo` along with
// any generic parameters.)
- let (output_ty, opaque_type_map) =
- obligations.add(infcx.instantiate_opaque_types(
- mir_def_id,
- dummy_body_id,
- param_env,
- anon_ty,
- locations.span(body),
- ));
+ let output_ty = obligations.add(infcx.instantiate_opaque_types(
+ dummy_body_id,
+ param_env,
+ anon_ty,
+ locations.span(body),
+ ));
debug!(
"eq_opaque_type_and_type: \
instantiated output_ty={:?} \
- opaque_type_map={:#?} \
revealed_ty={:?}",
- output_ty, opaque_type_map, revealed_ty
+ output_ty, revealed_ty
);
// Make sure that the inferred types are well-formed. I'm
.eq(output_ty, revealed_ty)?,
);
- for &(opaque_type_key, opaque_decl) in &opaque_type_map {
- opaque_type_values.insert(opaque_type_key, opaque_decl.concrete_ty);
- }
-
debug!("eq_opaque_type_and_type: equated");
- Ok(InferOk {
- value: Some(opaque_type_map),
- obligations: obligations.into_vec(),
- })
+ Ok(InferOk { value: (), obligations: obligations.into_vec() })
},
|| "input_output".to_string(),
),
)?;
- self.opaque_type_values.extend(opaque_type_values);
-
let universal_region_relations = self.universal_region_relations;
// Finally, if we instantiated the anon types successfully, we
// have to solve any bounds (e.g., `-> impl Iterator` needs to
// prove that `T: Iterator` where `T` is the type we
// instantiated it with).
- if let Some(opaque_type_map) = opaque_type_map {
- for (opaque_type_key, opaque_decl) in opaque_type_map {
- self.fully_perform_op(
- locations,
- ConstraintCategory::OpaqueType,
- CustomTypeOp::new(
- |infcx| {
- infcx.constrain_opaque_type(
- opaque_type_key,
- &opaque_decl,
- GenerateMemberConstraints::IfNoStaticBound,
- universal_region_relations,
- );
- Ok(InferOk { value: (), obligations: vec![] })
- },
- || "opaque_type_map".to_string(),
- ),
- )?;
- }
+ let opaque_type_map = self.infcx.inner.borrow().opaque_types.clone();
+ for (opaque_type_key, opaque_decl) in opaque_type_map {
+ self.fully_perform_op(
+ locations,
+ ConstraintCategory::OpaqueType,
+ CustomTypeOp::new(
+ |infcx| {
+ infcx.constrain_opaque_type(
+ opaque_type_key,
+ &opaque_decl,
+ GenerateMemberConstraints::IfNoStaticBound,
+ universal_region_relations,
+ );
+ Ok(InferOk { value: (), obligations: vec![] })
+ },
+ || "opaque_type_map".to_string(),
+ ),
+ )?;
}
Ok(())
}
);
self.copy_op(&self.operand_index(&args[0], index)?, dest)?;
}
- sym::likely | sym::unlikely => {
+ sym::likely | sym::unlikely | sym::black_box => {
// These just return their argument
self.copy_op(&args[0], dest)?;
}
format!("non-ASCII whitespace symbol '{}' is not skipped", c.escape_unicode());
handler.struct_span_warn(span, &msg).span_label(char_span, &msg).emit();
}
+ EscapeError::MultipleSkippedLinesWarning => {
+ let msg = "multiple lines skipped by escaped newline";
+ let bottom_msg = "skipping everything up to and including this point";
+ handler.struct_span_warn(span, msg).span_label(span, bottom_msg).emit();
+ }
}
}
+++ /dev/null
-//! Used by `rustc` when compiling a plugin crate.
-
-use rustc_hir as hir;
-use rustc_hir::def_id::LocalDefId;
-use rustc_hir::itemlikevisit::ItemLikeVisitor;
-use rustc_middle::ty::query::Providers;
-use rustc_middle::ty::TyCtxt;
-use rustc_span::symbol::sym;
-use rustc_span::Span;
-
-struct RegistrarFinder<'tcx> {
- tcx: TyCtxt<'tcx>,
- registrars: Vec<(LocalDefId, Span)>,
-}
-
-impl<'v, 'tcx> ItemLikeVisitor<'v> for RegistrarFinder<'tcx> {
- fn visit_item(&mut self, item: &hir::Item<'_>) {
- if let hir::ItemKind::Fn(..) = item.kind {
- let attrs = self.tcx.hir().attrs(item.hir_id());
- if self.tcx.sess.contains_name(attrs, sym::plugin_registrar) {
- self.registrars.push((item.def_id, item.span));
- }
- }
- }
-
- fn visit_trait_item(&mut self, _trait_item: &hir::TraitItem<'_>) {}
-
- fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem<'_>) {}
-
- fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {}
-}
-
-/// Finds the function marked with `#[plugin_registrar]`, if any.
-fn plugin_registrar_fn(tcx: TyCtxt<'_>, (): ()) -> Option<LocalDefId> {
- let mut finder = RegistrarFinder { tcx, registrars: Vec::new() };
- tcx.hir().krate().visit_all_item_likes(&mut finder);
-
- let (def_id, span) = finder.registrars.pop()?;
-
- if !finder.registrars.is_empty() {
- let diagnostic = tcx.sess.diagnostic();
- let mut e = diagnostic.struct_err("multiple plugin registration functions found");
- e.span_note(span, "one is here");
- for &(_, span) in &finder.registrars {
- e.span_note(span, "one is here");
- }
- e.emit();
- diagnostic.abort_if_errors();
- unreachable!();
- }
-
- Some(def_id)
-}
-
-pub fn provide(providers: &mut Providers) {
- *providers = Providers { plugin_registrar_fn, ..*providers };
-}
use rustc_lint::LintStore;
-pub mod build;
pub mod load;
/// Structure used to register plugins.
metadata_loader: &dyn MetadataLoader,
ident: Ident,
) {
- let (lib, disambiguator) =
- locator::find_plugin_registrar(sess, metadata_loader, ident.span, ident.name);
- let symbol = sess.generate_plugin_registrar_symbol(disambiguator);
- let fun = dylink_registrar(sess, ident.span, lib, symbol);
+ let lib = locator::find_plugin_registrar(sess, metadata_loader, ident.span, ident.name);
+ let fun = dylink_registrar(sess, ident.span, lib);
plugins.push(fun);
}
// Dynamically link a registrar function into the compiler process.
-fn dylink_registrar(
- sess: &Session,
- span: Span,
- path: PathBuf,
- symbol: String,
-) -> PluginRegistrarFn {
+fn dylink_registrar(sess: &Session, span: Span, path: PathBuf) -> PluginRegistrarFn {
use rustc_metadata::dynamic_lib::DynamicLibrary;
// Make sure the path contains a / or the linker will search for it.
};
unsafe {
- let registrar = match lib.symbol(&symbol) {
+ let registrar = match lib.symbol("__rustc_plugin_registrar") {
Ok(registrar) => mem::transmute::<*mut u8, PluginRegistrarFn>(registrar),
// again fatal if we can't register macros
Err(err) => sess.span_fatal(span, &err),
// Intentionally leak the dynamic library. We can't ever unload it
// since the library can make things that will live arbitrarily long
- // (e.g., an @-box cycle or a thread).
+ // (e.g., an Rc cycle or a thread).
mem::forget(lib);
registrar
)
}
- /// Returns the symbol name for the registrar function,
- /// given the crate `Svh` and the function `DefIndex`.
- pub fn generate_plugin_registrar_symbol(&self, stable_crate_id: StableCrateId) -> String {
- format!("__rustc_plugin_registrar_{:08x}__", stable_crate_id.to_u64())
- }
-
pub fn generate_proc_macro_decls_symbol(&self, stable_crate_id: StableCrateId) -> String {
format!("__rustc_proc_macro_decls_{:08x}__", stable_crate_id.to_u64())
}
bitreverse,
bitxor,
bitxor_assign,
+ black_box,
block,
bool,
borrowck_graphviz_format,
let hash = get_symbol_hash(tcx, instance, instance_ty, instantiating_crate);
- let mut printer = SymbolPrinter { tcx, path: SymbolPath::new(), keep_within_component: false }
+ let mut printer = SymbolPrinter { tcx, path: SymbolPath::new(), keep_within_component: false };
+ printer
.print_def_path(
def_id,
if let ty::InstanceDef::DropGlue(_, _) = instance.def {
// `PrettyPrinter` aka pretty printing of e.g. types in paths,
// symbol names should have their own printing machinery.
-impl Printer<'tcx> for SymbolPrinter<'tcx> {
+impl Printer<'tcx> for &mut SymbolPrinter<'tcx> {
type Error = fmt::Error;
type Path = Self;
Ok(self)
}
- fn print_const(mut self, ct: &'tcx ty::Const<'tcx>) -> Result<Self::Const, Self::Error> {
+ fn print_const(self, ct: &'tcx ty::Const<'tcx>) -> Result<Self::Const, Self::Error> {
// only print integers
if let ty::ConstKind::Value(ConstValue::Scalar(Scalar::Int { .. })) = ct.val {
if ct.ty.is_integral() {
Ok(self)
}
- fn path_crate(mut self, cnum: CrateNum) -> Result<Self::Path, Self::Error> {
+ fn path_crate(self, cnum: CrateNum) -> Result<Self::Path, Self::Error> {
self.write_str(&self.tcx.crate_name(cnum).as_str())?;
Ok(self)
}
}
}
-impl PrettyPrinter<'tcx> for SymbolPrinter<'tcx> {
+impl PrettyPrinter<'tcx> for &mut SymbolPrinter<'tcx> {
fn region_should_not_be_omitted(&self, _region: ty::Region<'_>) -> bool {
false
}
// FIXME(eddyb) Precompute a custom symbol name based on attributes.
let is_foreign = if let Some(def_id) = def_id.as_local() {
- if tcx.plugin_registrar_fn(()) == Some(def_id) {
- let stable_crate_id = tcx.sess.local_stable_crate_id();
- return tcx.sess.generate_plugin_registrar_symbol(stable_crate_id);
- }
if tcx.proc_macro_decls_static(()) == Some(def_id) {
let stable_crate_id = tcx.sess.local_stable_crate_id();
return tcx.sess.generate_proc_macro_decls_symbol(stable_crate_id);
("riscv32i-unknown-none-elf", riscv32i_unknown_none_elf),
("riscv32imc-unknown-none-elf", riscv32imc_unknown_none_elf),
+ ("riscv32imc-esp-espidf", riscv32imc_esp_espidf),
("riscv32imac-unknown-none-elf", riscv32imac_unknown_none_elf),
("riscv32gc-unknown-linux-gnu", riscv32gc_unknown_linux_gnu),
("riscv32gc-unknown-linux-musl", riscv32gc_unknown_linux_musl),
--- /dev/null
+use crate::spec::{LinkerFlavor, PanicStrategy, RelocModel};
+use crate::spec::{Target, TargetOptions};
+
+pub fn target() -> Target {
+ Target {
+ data_layout: "e-m:e-p:32:32-i64:64-n32-S128".to_string(),
+ llvm_target: "riscv32".to_string(),
+ pointer_width: 32,
+ arch: "riscv32".to_string(),
+
+ options: TargetOptions {
+ families: vec!["unix".to_string()],
+ os: "espidf".to_string(),
+ env: "newlib".to_string(),
+ vendor: "espressif".to_string(),
+ linker_flavor: LinkerFlavor::Gcc,
+ linker: Some("riscv32-esp-elf-gcc".to_string()),
+ cpu: "generic-rv32".to_string(),
+
+ // While the RiscV32IMC architecture does not natively support atomics, ESP-IDF does support
+ // the __atomic* and __sync* GCC builtins, so setting `max_atomic_width` to `Some(32)`
+ // and `atomic_cas` to `true` will cause the compiler to emit libcalls to these builtins.
+ //
+ // Support for atomics is necessary for the Rust STD library, which is supported by the ESP-IDF framework.
+ max_atomic_width: Some(32),
+ atomic_cas: true,
+
+ features: "+m,+c".to_string(),
+ executables: true,
+ panic_strategy: PanicStrategy::Abort,
+ relocation_model: RelocModel::Static,
+ emit_debug_gdb_scripts: false,
+ eh_frame_header: false,
+ ..Default::default()
+ },
+ }
+}
use crate::traits::{self, ObligationCause, PredicateObligation};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
-use rustc_data_structures::vec_map::VecMap;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_infer::infer::error_reporting::unexpected_hidden_region_diagnostic;
use rustc_infer::infer::free_regions::FreeRegionRelations;
+use rustc_infer::infer::opaque_types::OpaqueTypeDecl;
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use rustc_infer::infer::{self, InferCtxt, InferOk};
use rustc_middle::ty::fold::{BottomUpFolder, TypeFoldable, TypeFolder, TypeVisitor};
use std::ops::ControlFlow;
-pub type OpaqueTypeMap<'tcx> = VecMap<OpaqueTypeKey<'tcx>, OpaqueTypeDecl<'tcx>>;
-
-/// Information about the opaque types whose values we
-/// are inferring in this function (these are the `impl Trait` that
-/// appear in the return type).
-#[derive(Copy, Clone, Debug)]
-pub struct OpaqueTypeDecl<'tcx> {
- /// The opaque type (`ty::Opaque`) for this declaration.
- pub opaque_type: Ty<'tcx>,
-
- /// The span of this particular definition of the opaque type. So
- /// for example:
- ///
- /// ```ignore (incomplete snippet)
- /// type Foo = impl Baz;
- /// fn bar() -> Foo {
- /// // ^^^ This is the span we are looking for!
- /// }
- /// ```
- ///
- /// In cases where the fn returns `(impl Trait, impl Trait)` or
- /// other such combinations, the result is currently
- /// over-approximated, but better than nothing.
- pub definition_span: Span,
-
- /// The type variable that represents the value of the opaque type
- /// that we require. In other words, after we compile this function,
- /// we will be created a constraint like:
- ///
- /// Foo<'a, T> = ?C
- ///
- /// where `?C` is the value of this type variable. =) It may
- /// naturally refer to the type and lifetime parameters in scope
- /// in this function, though ultimately it should only reference
- /// those that are arguments to `Foo` in the constraint above. (In
- /// other words, `?C` should not include `'b`, even though it's a
- /// lifetime parameter on `foo`.)
- pub concrete_ty: Ty<'tcx>,
-
- /// Returns `true` if the `impl Trait` bounds include region bounds.
- /// For example, this would be true for:
- ///
- /// fn foo<'a, 'b, 'c>() -> impl Trait<'c> + 'a + 'b
- ///
- /// but false for:
- ///
- /// fn foo<'c>() -> impl Trait<'c>
- ///
- /// unless `Trait` was declared like:
- ///
- /// trait Trait<'c>: 'c
- ///
- /// in which case it would be true.
- ///
- /// This is used during regionck to decide whether we need to
- /// impose any additional constraints to ensure that region
- /// variables in `concrete_ty` wind up being constrained to
- /// something from `substs` (or, at minimum, things that outlive
- /// the fn body). (Ultimately, writeback is responsible for this
- /// check.)
- pub has_required_region_bounds: bool,
-
- /// The origin of the opaque type.
- pub origin: hir::OpaqueTyOrigin,
-}
-
/// Whether member constraints should be generated for all opaque types
#[derive(Debug)]
pub enum GenerateMemberConstraints {
pub trait InferCtxtExt<'tcx> {
fn instantiate_opaque_types<T: TypeFoldable<'tcx>>(
&self,
- parent_def_id: LocalDefId,
body_id: hir::HirId,
param_env: ty::ParamEnv<'tcx>,
value: T,
value_span: Span,
- ) -> InferOk<'tcx, (T, OpaqueTypeMap<'tcx>)>;
+ ) -> InferOk<'tcx, T>;
- fn constrain_opaque_types<FRR: FreeRegionRelations<'tcx>>(
- &self,
- opaque_types: &OpaqueTypeMap<'tcx>,
- free_region_relations: &FRR,
- );
+ fn constrain_opaque_types<FRR: FreeRegionRelations<'tcx>>(&self, free_region_relations: &FRR);
fn constrain_opaque_type<FRR: FreeRegionRelations<'tcx>>(
&self,
/// - `value_span` -- the span where the value came from, used in error reporting
fn instantiate_opaque_types<T: TypeFoldable<'tcx>>(
&self,
- parent_def_id: LocalDefId,
body_id: hir::HirId,
param_env: ty::ParamEnv<'tcx>,
value: T,
value_span: Span,
- ) -> InferOk<'tcx, (T, OpaqueTypeMap<'tcx>)> {
+ ) -> InferOk<'tcx, T> {
debug!(
- "instantiate_opaque_types(value={:?}, parent_def_id={:?}, body_id={:?}, \
+ "instantiate_opaque_types(value={:?}, body_id={:?}, \
param_env={:?}, value_span={:?})",
- value, parent_def_id, body_id, param_env, value_span,
+ value, body_id, param_env, value_span,
);
- let mut instantiator = Instantiator {
- infcx: self,
- parent_def_id,
- body_id,
- param_env,
- value_span,
- opaque_types: Default::default(),
- obligations: vec![],
- };
+ let mut instantiator =
+ Instantiator { infcx: self, body_id, param_env, value_span, obligations: vec![] };
let value = instantiator.instantiate_opaque_types_in_map(value);
- InferOk { value: (value, instantiator.opaque_types), obligations: instantiator.obligations }
+ InferOk { value, obligations: instantiator.obligations }
}
/// Given the map `opaque_types` containing the opaque
/// - `opaque_types` -- the map produced by `instantiate_opaque_types`
/// - `free_region_relations` -- something that can be used to relate
/// the free regions (`'a`) that appear in the impl trait.
- fn constrain_opaque_types<FRR: FreeRegionRelations<'tcx>>(
- &self,
- opaque_types: &OpaqueTypeMap<'tcx>,
- free_region_relations: &FRR,
- ) {
- for &(opaque_type_key, opaque_defn) in opaque_types {
+ fn constrain_opaque_types<FRR: FreeRegionRelations<'tcx>>(&self, free_region_relations: &FRR) {
+ let opaque_types = self.inner.borrow().opaque_types.clone();
+ for (opaque_type_key, opaque_defn) in opaque_types {
self.constrain_opaque_type(
opaque_type_key,
&opaque_defn,
let span = tcx.def_span(def_id);
- // If there are required region bounds, we can use them.
- if opaque_defn.has_required_region_bounds {
- let bounds = tcx.explicit_item_bounds(def_id);
- debug!("{:#?}", bounds);
- let bounds: Vec<_> =
- bounds.iter().map(|(bound, _)| bound.subst(tcx, opaque_type_key.substs)).collect();
- debug!("{:#?}", bounds);
- let opaque_type = tcx.mk_opaque(def_id, opaque_type_key.substs);
-
- let required_region_bounds =
- required_region_bounds(tcx, opaque_type, bounds.into_iter());
- debug_assert!(!required_region_bounds.is_empty());
-
+ // Check if the `impl Trait` bounds include region bounds.
+ // For example, this would be true for:
+ //
+ // fn foo<'a, 'b, 'c>() -> impl Trait<'c> + 'a + 'b
+ //
+ // but false for:
+ //
+ // fn foo<'c>() -> impl Trait<'c>
+ //
+ // unless `Trait` was declared like:
+ //
+ // trait Trait<'c>: 'c
+ //
+ // in which case it would be true.
+ //
+ // This is used during regionck to decide whether we need to
+ // impose any additional constraints to ensure that region
+ // variables in `concrete_ty` wind up being constrained to
+ // something from `substs` (or, at minimum, things that outlive
+ // the fn body). (Ultimately, writeback is responsible for this
+ // check.)
+ let bounds = tcx.explicit_item_bounds(def_id);
+ debug!("{:#?}", bounds);
+ let bounds = bounds.iter().map(|(bound, _)| bound.subst(tcx, opaque_type_key.substs));
+ debug!("{:#?}", bounds);
+ let opaque_type = tcx.mk_opaque(def_id, opaque_type_key.substs);
+
+ let required_region_bounds = required_region_bounds(tcx, opaque_type, bounds);
+ if !required_region_bounds.is_empty() {
for required_region in required_region_bounds {
concrete_ty.visit_with(&mut ConstrainOpaqueTypeRegionVisitor {
op: |r| self.sub_regions(infer::CallReturn(span), required_region, r),
struct Instantiator<'a, 'tcx> {
infcx: &'a InferCtxt<'a, 'tcx>,
- parent_def_id: LocalDefId,
body_id: hir::HirId,
param_env: ty::ParamEnv<'tcx>,
value_span: Span,
- opaque_types: OpaqueTypeMap<'tcx>,
obligations: Vec<PredicateObligation<'tcx>>,
}
// ```
if let Some(def_id) = def_id.as_local() {
let opaque_hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
- let parent_def_id = self.parent_def_id;
+ let parent_def_id = self.infcx.defining_use_anchor;
let def_scope_default = || {
let opaque_parent_hir_id = tcx.hir().get_parent_item(opaque_hir_id);
parent_def_id == tcx.hir().local_def_id(opaque_parent_hir_id)
impl_trait_fn: Some(parent),
origin,
..
- }) => (parent == self.parent_def_id.to_def_id(), origin),
+ }) => (parent == parent_def_id.to_def_id(), origin),
// Named `type Foo = impl Bar;`
hir::ItemKind::OpaqueTy(hir::OpaqueTy {
impl_trait_fn: None,
origin,
..
}) => (
- may_define_opaque_type(tcx, self.parent_def_id, opaque_hir_id),
+ may_define_opaque_type(tcx, parent_def_id, opaque_hir_id),
origin,
),
_ => (def_scope_default(), hir::OpaqueTyOrigin::TyAlias),
// Use the same type variable if the exact same opaque type appears more
// than once in the return type (e.g., if it's passed to a type alias).
- if let Some(opaque_defn) = self.opaque_types.get(&opaque_type_key) {
+ if let Some(opaque_defn) = infcx.inner.borrow().opaque_types.get(&opaque_type_key) {
debug!("instantiate_opaque_types: returning concrete ty {:?}", opaque_defn.concrete_ty);
return opaque_defn.concrete_ty;
}
- let span = tcx.def_span(def_id);
- debug!("fold_opaque_ty {:?} {:?}", self.value_span, span);
- let ty_var = infcx
- .next_ty_var(TypeVariableOrigin { kind: TypeVariableOriginKind::TypeInference, span });
-
- let item_bounds = tcx.explicit_item_bounds(def_id);
- debug!("instantiate_opaque_types: bounds={:#?}", item_bounds);
- let bounds: Vec<_> =
- item_bounds.iter().map(|(bound, _)| bound.subst(tcx, substs)).collect();
-
- let param_env = tcx.param_env(def_id);
- let InferOk { value: bounds, obligations } = infcx.partially_normalize_associated_types_in(
- ObligationCause::misc(span, self.body_id),
- param_env,
- bounds,
- );
- self.obligations.extend(obligations);
-
- debug!("instantiate_opaque_types: bounds={:?}", bounds);
-
- let required_region_bounds = required_region_bounds(tcx, ty, bounds.iter().copied());
- debug!("instantiate_opaque_types: required_region_bounds={:?}", required_region_bounds);
+ let ty_var = infcx.next_ty_var(TypeVariableOrigin {
+ kind: TypeVariableOriginKind::TypeInference,
+ span: self.value_span,
+ });
// Make sure that we are in fact defining the *entire* type
// (e.g., `type Foo<T: Bound> = impl Bar;` needs to be
// Foo, impl Bar)`.
let definition_span = self.value_span;
- self.opaque_types.insert(
- OpaqueTypeKey { def_id, substs },
- OpaqueTypeDecl {
- opaque_type: ty,
- definition_span,
- concrete_ty: ty_var,
- has_required_region_bounds: !required_region_bounds.is_empty(),
- origin,
- },
- );
+ {
+ let mut infcx = self.infcx.inner.borrow_mut();
+ infcx.opaque_types.insert(
+ OpaqueTypeKey { def_id, substs },
+ OpaqueTypeDecl { opaque_type: ty, definition_span, concrete_ty: ty_var, origin },
+ );
+ infcx.opaque_types_vars.insert(ty_var, ty);
+ }
+
debug!("instantiate_opaque_types: ty_var={:?}", ty_var);
+ self.compute_opaque_type_obligations(opaque_type_key);
+
+ ty_var
+ }
+
+ fn compute_opaque_type_obligations(&mut self, opaque_type_key: OpaqueTypeKey<'tcx>) {
+ let infcx = self.infcx;
+ let tcx = infcx.tcx;
+ let OpaqueTypeKey { def_id, substs } = opaque_type_key;
+
+ let item_bounds = tcx.explicit_item_bounds(def_id);
+ debug!("instantiate_opaque_types: bounds={:#?}", item_bounds);
+ let bounds: Vec<_> =
+ item_bounds.iter().map(|(bound, _)| bound.subst(tcx, substs)).collect();
+
+ let param_env = tcx.param_env(def_id);
+ let InferOk { value: bounds, obligations } = infcx.partially_normalize_associated_types_in(
+ ObligationCause::misc(self.value_span, self.body_id),
+ param_env,
+ bounds,
+ );
+ self.obligations.extend(obligations);
+
+ debug!("instantiate_opaque_types: bounds={:?}", bounds);
for predicate in &bounds {
if let ty::PredicateKind::Projection(projection) = predicate.kind().skip_binder() {
if projection.ty.references_error() {
// No point on adding these obligations since there's a type error involved.
- return ty_var;
+ return;
}
}
}
// This also instantiates nested instances of `impl Trait`.
let predicate = self.instantiate_opaque_types_in_map(predicate);
- let cause = traits::ObligationCause::new(span, self.body_id, traits::OpaqueType);
+ let cause =
+ traits::ObligationCause::new(self.value_span, self.body_id, traits::OpaqueType);
// Require that the predicate holds for the concrete type.
debug!("instantiate_opaque_types: predicate={:?}", predicate);
self.obligations.push(traits::Obligation::new(cause, self.param_env, predicate));
}
-
- ty_var
}
}
if let ObligationCauseCode::WellFormed(Some(wf_loc)) =
root_obligation.cause.code.peel_derives()
{
- if let Some(cause) =
- self.tcx.diagnostic_hir_wf_check((obligation.predicate, wf_loc.clone()))
- {
+ if let Some(cause) = self.tcx.diagnostic_hir_wf_check((
+ tcx.erase_regions(obligation.predicate),
+ wf_loc.clone(),
+ )) {
obligation.cause = cause;
span = obligation.cause.span;
}
orig_expected: Expectation<'tcx>,
) -> Option<Span> {
match (orig_expected, self.ret_coercion_impl_trait.map(|ty| (self.body_id.owner, ty))) {
- (Expectation::ExpectHasType(expected), Some((id, ty)))
+ (Expectation::ExpectHasType(expected), Some((_id, ty)))
if self.in_tail_expr && self.can_coerce(outer_ty, expected) =>
{
let impl_trait_ret_ty =
- self.infcx.instantiate_opaque_types(id, self.body_id, self.param_env, ty, span);
- let mut suggest_box = !impl_trait_ret_ty.obligations.is_empty();
- for o in impl_trait_ret_ty.obligations {
+ self.infcx.instantiate_opaque_types(self.body_id, self.param_env, ty, span);
+ assert!(
+ impl_trait_ret_ty.obligations.is_empty(),
+ "we should never get new obligations here"
+ );
+ let obligations = self.fulfillment_cx.borrow().pending_obligations();
+ let mut suggest_box = !obligations.is_empty();
+ for o in obligations {
match o.predicate.kind().skip_binder() {
ty::PredicateKind::Trait(t, constness) => {
let pred = ty::PredicateKind::Trait(
let declared_ret_ty = fn_sig.output();
- let feature = match tcx.hir().get(fn_id) {
- // TAIT usage in function return position.
- // Example:
- //
- // ```rust
- // type Foo = impl Debug;
- // fn bar() -> Foo { 42 }
- // ```
- Node::Item(hir::Item { kind: ItemKind::Fn(..), .. }) |
- // TAIT usage in associated function return position.
- //
- // Example with a free type alias:
- //
- // ```rust
- // type Foo = impl Debug;
- // impl SomeTrait for SomeType {
- // fn bar() -> Foo { 42 }
- // }
- // ```
- //
- // Example with an associated TAIT:
- //
- // ```rust
- // impl SomeTrait for SomeType {
- // type Foo = impl Debug;
- // fn bar() -> Self::Foo { 42 }
- // }
- // ```
- Node::ImplItem(hir::ImplItem {
- kind: hir::ImplItemKind::Fn(..), ..
- }) => None,
- // Forbid TAIT in trait declarations for now.
- // Examples:
- //
- // ```rust
- // type Foo = impl Debug;
- // trait Bar {
- // fn bar() -> Foo;
- // }
- // trait Bop {
- // type Bop: PartialEq<Foo>;
- // }
- // ```
- Node::TraitItem(hir::TraitItem {
- kind: hir::TraitItemKind::Fn(..),
- ..
- }) |
- // Forbid TAIT in closure return position for now.
- // Example:
- //
- // ```rust
- // type Foo = impl Debug;
- // let x = |y| -> Foo { 42 + y };
- // ```
- Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(..), .. }) => Some(sym::type_alias_impl_trait),
- node => bug!("Item being checked wasn't a function/closure: {:?}", node),
- };
- let revealed_ret_ty = fcx.instantiate_opaque_types_from_value(
- fn_id,
- declared_ret_ty,
- decl.output.span(),
- feature,
- );
+ let revealed_ret_ty =
+ fcx.instantiate_opaque_types_from_value(declared_ret_ty, decl.output.span());
debug!("check_fn: declared_ret_ty: {}, revealed_ret_ty: {}", declared_ret_ty, revealed_ret_ty);
fcx.ret_coercion = Some(RefCell::new(CoerceMany::new(revealed_ret_ty)));
fcx.ret_type_span = Some(decl.output.span());
let misc_cause = traits::ObligationCause::misc(span, hir_id);
- let (_, opaque_type_map) = inh.register_infer_ok_obligations(
- infcx.instantiate_opaque_types(def_id, hir_id, param_env, opaque_ty, span),
+ let _ = inh.register_infer_ok_obligations(
+ infcx.instantiate_opaque_types(hir_id, param_env, opaque_ty, span),
);
+ let opaque_type_map = infcx.inner.borrow().opaque_types.clone();
for (OpaqueTypeKey { def_id, substs }, opaque_defn) in opaque_type_map {
match infcx
.at(&misc_cause, param_env)
.emit();
}
} else if check_completeness && !error_happened && !remaining_fields.is_empty() {
- let no_accessible_remaining_fields = remaining_fields
- .iter()
- .find(|(_, (_, field))| {
- field.vis.is_accessible_from(tcx.parent_module(expr_id).to_def_id(), tcx)
- })
- .is_none();
+ let inaccessible_remaining_fields = remaining_fields.iter().any(|(_, (_, field))| {
+ !field.vis.is_accessible_from(tcx.parent_module(expr_id).to_def_id(), tcx)
+ });
- if no_accessible_remaining_fields {
- self.report_no_accessible_fields(adt_ty, span);
+ if inaccessible_remaining_fields {
+ self.report_inaccessible_fields(adt_ty, span);
} else {
self.report_missing_fields(adt_ty, span, remaining_fields);
}
.emit();
}
- /// Report an error for a struct field expression when there are no visible fields.
+ /// Report an error for a struct field expression when there are invisible fields.
///
/// ```text
/// error: cannot construct `Foo` with struct literal syntax due to inaccessible fields
///
/// error: aborting due to previous error
/// ```
- fn report_no_accessible_fields(&self, adt_ty: Ty<'tcx>, span: Span) {
+ fn report_inaccessible_fields(&self, adt_ty: Ty<'tcx>, span: Span) {
self.tcx.sess.span_err(
span,
&format!(
};
use rustc_session::lint;
use rustc_session::lint::builtin::BARE_TRAIT_OBJECTS;
-use rustc_session::parse::feature_err;
use rustc_span::edition::Edition;
+use rustc_span::hygiene::DesugaringKind;
use rustc_span::source_map::{original_sp, DUMMY_SP};
use rustc_span::symbol::{kw, sym, Ident};
use rustc_span::{self, BytePos, MultiSpan, Span};
-use rustc_span::{hygiene::DesugaringKind, Symbol};
use rustc_trait_selection::infer::InferCtxtExt as _;
use rustc_trait_selection::opaque_types::InferCtxtExt as _;
use rustc_trait_selection::traits::error_reporting::InferCtxtExt as _;
/// Replaces the opaque types from the given value with type variables,
/// and records the `OpaqueTypeMap` for later use during writeback. See
/// `InferCtxt::instantiate_opaque_types` for more details.
+ #[instrument(skip(self, value_span), level = "debug")]
pub(in super::super) fn instantiate_opaque_types_from_value<T: TypeFoldable<'tcx>>(
&self,
- parent_id: hir::HirId,
value: T,
value_span: Span,
- feature: Option<Symbol>,
) -> T {
- let parent_def_id = self.tcx.hir().local_def_id(parent_id);
- debug!(
- "instantiate_opaque_types_from_value(parent_def_id={:?}, value={:?})",
- parent_def_id, value
- );
-
- let (value, opaque_type_map) =
- self.register_infer_ok_obligations(self.instantiate_opaque_types(
- parent_def_id,
- self.body_id,
- self.param_env,
- value,
- value_span,
- ));
-
- let mut opaque_types = self.opaque_types.borrow_mut();
- let mut opaque_types_vars = self.opaque_types_vars.borrow_mut();
-
- for (ty, decl) in opaque_type_map {
- if let Some(feature) = feature {
- if let hir::OpaqueTyOrigin::TyAlias = decl.origin {
- if !self.tcx.features().enabled(feature) {
- feature_err(
- &self.tcx.sess.parse_sess,
- feature,
- value_span,
- "type alias impl trait is not permitted here",
- )
- .emit();
- }
- }
- }
- let _ = opaque_types.insert(ty, decl);
- let _ = opaque_types_vars.insert(decl.concrete_ty, decl.opaque_type);
- }
-
- value
+ self.register_infer_ok_obligations(self.instantiate_opaque_types(
+ self.body_id,
+ self.param_env,
+ value,
+ value_span,
+ ))
}
/// Convenience method which tracks extra diagnostic information for normalization
// We treat this as a non-defining use by making the inference
// variable fall back to the opaque type itself.
if let FallbackMode::All = mode {
- if let Some(opaque_ty) = self.opaque_types_vars.borrow().get(ty) {
+ if let Some(opaque_ty) = self.infcx.inner.borrow().opaque_types_vars.get(ty) {
debug!(
"fallback_if_possible: falling back opaque type var {:?} to {:?}",
ty, opaque_ty
use super::callee::DeferredCallResolution;
use super::MaybeInProgressTables;
-use rustc_data_structures::fx::FxHashMap;
-use rustc_data_structures::vec_map::VecMap;
use rustc_hir as hir;
use rustc_hir::def_id::{DefIdMap, LocalDefId};
use rustc_hir::HirIdMap;
use rustc_infer::infer;
use rustc_infer::infer::{InferCtxt, InferOk, TyCtxtInferExt};
use rustc_middle::ty::fold::TypeFoldable;
-use rustc_middle::ty::{self, OpaqueTypeKey, Ty, TyCtxt};
+use rustc_middle::ty::{self, Ty, TyCtxt};
use rustc_span::{self, Span};
use rustc_trait_selection::infer::InferCtxtExt as _;
-use rustc_trait_selection::opaque_types::OpaqueTypeDecl;
use rustc_trait_selection::traits::{self, ObligationCause, TraitEngine, TraitEngineExt};
use std::cell::RefCell;
pub(super) deferred_generator_interiors:
RefCell<Vec<(hir::BodyId, Ty<'tcx>, hir::GeneratorKind)>>,
- // Opaque types found in explicit return types and their
- // associated fresh inference variable. Writeback resolves these
- // variables to get the concrete type, which can be used to
- // 'de-opaque' OpaqueTypeDecl, after typeck is done with all functions.
- pub(super) opaque_types: RefCell<VecMap<OpaqueTypeKey<'tcx>, OpaqueTypeDecl<'tcx>>>,
-
- /// A map from inference variables created from opaque
- /// type instantiations (`ty::Infer`) to the actual opaque
- /// type (`ty::Opaque`). Used during fallback to map unconstrained
- /// opaque type inference variables to their corresponding
- /// opaque type.
- pub(super) opaque_types_vars: RefCell<FxHashMap<Ty<'tcx>, Ty<'tcx>>>,
-
pub(super) body_id: Option<hir::BodyId>,
}
deferred_call_resolutions: RefCell::new(Default::default()),
deferred_cast_checks: RefCell::new(Vec::new()),
deferred_generator_interiors: RefCell::new(Vec::new()),
- opaque_types: RefCell::new(Default::default()),
- opaque_types_vars: RefCell::new(Default::default()),
body_id,
}
}
| sym::maxnumf64
| sym::type_name
| sym::forget
+ | sym::black_box
| sym::variant_count => hir::Unsafety::Normal,
_ => hir::Unsafety::Unsafe,
}
(1, vec![param_ty; 2], tcx.types.bool)
}
+ sym::black_box => (1, vec![param(0)], param(0)),
+
other => {
tcx.sess.emit_err(UnrecognizedIntrinsicFunction { span: it.span, name: other });
return;
source_map: &source_map::SourceMap,
) {
let mut applicability = Applicability::MachineApplicable;
- let sugg_args = if let (ty::AssocKind::Fn, Some(args)) = (kind, args) {
- format!(
+ let (span, sugg) = if let (ty::AssocKind::Fn, Some(args)) = (kind, args) {
+ let args = format!(
"({}{})",
if rcvr_ty.is_region_ptr() {
if rcvr_ty.is_mutable_ptr() { "&mut " } else { "&" }
}))
.collect::<Vec<_>>()
.join(", "),
- )
+ );
+ (span, format!("{}::{}{}", trait_name, item_name, args))
} else {
- String::new()
+ (span.with_hi(item_name.span.lo()), format!("{}::", trait_name))
};
- let sugg = format!("{}::{}{}", trait_name, item_name, sugg_args);
- err.span_suggestion(
+ err.span_suggestion_verbose(
span,
&format!(
"disambiguate the {} for {}",
tcx.sess.struct_span_err(pat.span, "`..` cannot be used in union patterns").emit();
}
} else if !etc && !unmentioned_fields.is_empty() {
- let no_accessible_unmentioned_fields = !unmentioned_fields.iter().any(|(field, _)| {
- field.vis.is_accessible_from(tcx.parent_module(pat.hir_id).to_def_id(), tcx)
- });
+ let accessible_unmentioned_fields: Vec<_> = unmentioned_fields
+ .iter()
+ .copied()
+ .filter(|(field, _)| {
+ field.vis.is_accessible_from(tcx.parent_module(pat.hir_id).to_def_id(), tcx)
+ })
+ .collect();
- if no_accessible_unmentioned_fields {
+ if accessible_unmentioned_fields.is_empty() {
unmentioned_err = Some(self.error_no_accessible_fields(pat, &fields));
} else {
- unmentioned_err =
- Some(self.error_unmentioned_fields(pat, &unmentioned_fields, &fields));
+ unmentioned_err = Some(self.error_unmentioned_fields(
+ pat,
+ &accessible_unmentioned_fields,
+ accessible_unmentioned_fields.len() != unmentioned_fields.len(),
+ &fields,
+ ));
}
}
match (inexistent_fields_err, unmentioned_err) {
&self,
pat: &Pat<'_>,
unmentioned_fields: &[(&ty::FieldDef, Ident)],
+ have_inaccessible_fields: bool,
fields: &'tcx [hir::PatField<'tcx>],
) -> DiagnosticBuilder<'tcx> {
+ let inaccessible = if have_inaccessible_fields { " and inaccessible fields" } else { "" };
let field_names = if unmentioned_fields.len() == 1 {
- format!("field `{}`", unmentioned_fields[0].1)
+ format!("field `{}`{}", unmentioned_fields[0].1, inaccessible)
} else {
let fields = unmentioned_fields
.iter()
.map(|(_, name)| format!("`{}`", name))
.collect::<Vec<String>>()
.join(", ");
- format!("fields {}", fields)
+ format!("fields {}{}", fields, inaccessible)
};
let mut err = struct_span_err!(
self.tcx.sess,
err.span_suggestion(
sp,
&format!(
- "include the missing field{} in the pattern",
+ "include the missing field{} in the pattern{}",
if len == 1 { "" } else { "s" },
+ if have_inaccessible_fields { " and ignore the inaccessible fields" } else { "" }
),
format!(
- "{}{}{}",
+ "{}{}{}{}",
prefix,
unmentioned_fields
.iter()
.map(|(_, name)| name.to_string())
.collect::<Vec<_>>()
.join(", "),
+ if have_inaccessible_fields { ", .." } else { "" },
postfix,
),
Applicability::MachineApplicable,
self.visit_body(body);
self.visit_region_obligations(body_id.hir_id);
- self.constrain_opaque_types(
- &self.fcx.opaque_types.borrow(),
- self.outlives_environment.free_region_map(),
- );
+ self.constrain_opaque_types(self.outlives_environment.free_region_map());
}
fn visit_region_obligations(&mut self, hir_id: hir::HirId) {
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
let trait_item = tcx.hir().expect_trait_item(hir_id);
- let method_sig = match trait_item.kind {
- hir::TraitItemKind::Fn(ref sig, _) => Some(sig),
- _ => None,
+ let (method_sig, span) = match trait_item.kind {
+ hir::TraitItemKind::Fn(ref sig, _) => (Some(sig), trait_item.span),
+ hir::TraitItemKind::Type(_bounds, Some(ty)) => (None, ty.span),
+ _ => (None, trait_item.span),
};
check_object_unsafe_self_trait_by_name(tcx, &trait_item);
- check_associated_item(tcx, trait_item.hir_id(), trait_item.span, method_sig);
+ check_associated_item(tcx, trait_item.hir_id(), span, method_sig);
}
fn could_be_self(trait_def_id: LocalDefId, ty: &hir::Ty<'_>) -> bool {
let hir_id = tcx.hir().local_def_id_to_hir_id(def_id);
let impl_item = tcx.hir().expect_impl_item(hir_id);
- let method_sig = match impl_item.kind {
- hir::ImplItemKind::Fn(ref sig, _) => Some(sig),
- _ => None,
+ let (method_sig, span) = match impl_item.kind {
+ hir::ImplItemKind::Fn(ref sig, _) => (Some(sig), impl_item.span),
+ hir::ImplItemKind::TyAlias(ty) => (None, ty.span),
+ _ => (None, impl_item.span),
};
- check_associated_item(tcx, impl_item.hir_id(), impl_item.span, method_sig);
+ check_associated_item(tcx, impl_item.hir_id(), span, method_sig);
}
fn check_param_wf(tcx: TyCtxt<'_>, param: &hir::GenericParam<'_>) {
}
fn visit_opaque_types(&mut self, span: Span) {
- for &(opaque_type_key, opaque_defn) in self.fcx.opaque_types.borrow().iter() {
+ let opaque_types = self.fcx.infcx.inner.borrow().opaque_types.clone();
+ for (opaque_type_key, opaque_defn) in opaque_types {
let hir_id =
self.tcx().hir().local_def_id_to_hir_id(opaque_type_key.def_id.expect_local());
let instantiated_ty = self.resolve(opaque_defn.concrete_ty, &hir_id);
// Try to use the segment resolution if it is valid, otherwise we
// default to the path resolution.
let res = segment.res.filter(|&r| r != Res::Err).unwrap_or(path.res);
+ use def::CtorOf;
let generics = match res {
- Res::Def(DefKind::Ctor(..), def_id) => {
+ Res::Def(DefKind::Ctor(CtorOf::Variant, _), def_id) => tcx.generics_of(
+ tcx.parent(def_id).and_then(|def_id| tcx.parent(def_id)).unwrap(),
+ ),
+ Res::Def(DefKind::Variant | DefKind::Ctor(CtorOf::Struct, _), def_id) => {
tcx.generics_of(tcx.parent(def_id).unwrap())
}
// Other `DefKind`s don't have generics and would ICE when calling
DefKind::Struct
| DefKind::Union
| DefKind::Enum
- | DefKind::Variant
| DefKind::Trait
| DefKind::OpaqueTy
| DefKind::TyAlias
issue = "48043"
)]
impl From<TryReserveErrorKind> for TryReserveError {
+ #[inline]
fn from(kind: TryReserveErrorKind) -> Self {
Self { kind }
}
#![feature(allocator_api)]
+#![feature(assert_matches)]
#![feature(box_syntax)]
#![feature(cow_is_borrowed)]
#![feature(const_cow_is_borrowed)]
+use std::assert_matches::assert_matches;
use std::borrow::Cow;
use std::cell::Cell;
use std::collections::TryReserveErrorKind::*;
if guards_against_isize {
// Check isize::MAX + 1 does count as overflow
- if let Err(CapacityOverflow) =
- empty_string.try_reserve(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!")
- }
+ assert_matches!(
+ empty_string.try_reserve(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
// Check usize::MAX does count as overflow
- if let Err(CapacityOverflow) = empty_string.try_reserve(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ empty_string.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
} else {
// Check isize::MAX + 1 is an OOM
- if let Err(AllocError { .. }) =
- empty_string.try_reserve(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ empty_string.try_reserve(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
// Check usize::MAX is an OOM
- if let Err(AllocError { .. }) =
- empty_string.try_reserve(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an OOM!")
- }
+ assert_matches!(
+ empty_string.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "usize::MAX should trigger an OOM!"
+ );
}
}
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) = ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) = ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
// Should always overflow in the add-to-len
- if let Err(CapacityOverflow) = ten_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()) {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
}
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- empty_string.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!")
- }
-
- if let Err(CapacityOverflow) =
- empty_string.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ empty_string.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
+
+ assert_matches!(
+ empty_string.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) =
- empty_string.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
-
- if let Err(AllocError { .. }) =
- empty_string.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an OOM!")
- }
+ assert_matches!(
+ empty_string.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
+
+ assert_matches!(
+ empty_string.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "usize::MAX should trigger an OOM!"
+ );
}
}
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
- } else {
- if let Err(AllocError { .. }) =
- ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
- }
- if let Err(CapacityOverflow) = ten_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- panic!("usize::MAX should trigger an overflow!")
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
}
+use std::assert_matches::assert_matches;
use std::borrow::Cow;
use std::cell::Cell;
use std::collections::TryReserveErrorKind::*;
if guards_against_isize {
// Check isize::MAX + 1 does count as overflow
- if let Err(CapacityOverflow) =
- empty_bytes.try_reserve(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
// Check usize::MAX does count as overflow
- if let Err(CapacityOverflow) = empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
} else {
// Check isize::MAX + 1 is an OOM
- if let Err(AllocError { .. }) =
- empty_bytes.try_reserve(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
// Check usize::MAX is an OOM
- if let Err(AllocError { .. }) = empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an OOM!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "usize::MAX should trigger an OOM!"
+ );
}
}
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) = ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) = ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
// Should always overflow in the add-to-len
- if let Err(CapacityOverflow) = ten_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()) {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
{
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
+ assert_matches!(
+ ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) =
- ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
// Should fail in the mul-by-size
- if let Err(CapacityOverflow) = ten_u32s.try_reserve(MAX_USIZE - 20).map_err(|e| e.kind()) {
- } else {
- panic!("usize::MAX should trigger an overflow!");
- }
+ assert_matches!(
+ ten_u32s.try_reserve(MAX_USIZE - 20).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
}
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- empty_bytes.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!")
- }
-
- if let Err(CapacityOverflow) =
- empty_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
+
+ assert_matches!(
+ empty_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) =
- empty_bytes.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
- if let Err(AllocError { .. }) =
- empty_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an OOM!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "usize::MAX should trigger an OOM!"
+ );
}
}
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
- } else {
- if let Err(AllocError { .. }) =
- ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
- }
- if let Err(CapacityOverflow) = ten_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- panic!("usize::MAX should trigger an overflow!")
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
{
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
+ assert_matches!(
+ ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) =
- ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
- }
- if let Err(CapacityOverflow) =
- ten_u32s.try_reserve_exact(MAX_USIZE - 20).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
+ }
+ assert_matches!(
+ ten_u32s.try_reserve_exact(MAX_USIZE - 20).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
}
+use std::assert_matches::assert_matches;
use std::collections::TryReserveErrorKind::*;
use std::collections::{vec_deque::Drain, VecDeque};
use std::fmt::Debug;
if guards_against_isize {
// Check isize::MAX + 1 does count as overflow
- if let Err(CapacityOverflow) =
- empty_bytes.try_reserve(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
// Check usize::MAX does count as overflow
- if let Err(CapacityOverflow) = empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
} else {
// Check isize::MAX is an OOM
// VecDeque starts with capacity 7, always adds 1 to the capacity
// and also rounds the number to next power of 2 so this is the
// furthest we can go without triggering CapacityOverflow
- if let Err(AllocError { .. }) = empty_bytes.try_reserve(MAX_CAP).map_err(|e| e.kind()) {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_CAP).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
}
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) = ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) = ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
// Should always overflow in the add-to-len
- if let Err(CapacityOverflow) = ten_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()) {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ ten_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
{
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
+ assert_matches!(
+ ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- if let Err(AllocError { .. }) =
- ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ ten_u32s.try_reserve(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
// Should fail in the mul-by-size
- if let Err(CapacityOverflow) = ten_u32s.try_reserve(MAX_USIZE - 20).map_err(|e| e.kind()) {
- } else {
- panic!("usize::MAX should trigger an overflow!");
- }
+ assert_matches!(
+ ten_u32s.try_reserve(MAX_USIZE - 20).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
}
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- empty_bytes.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!")
- }
-
- if let Err(CapacityOverflow) =
- empty_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
- } else {
- panic!("usize::MAX should trigger an overflow!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve_exact(MAX_CAP + 1).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
+
+ assert_matches!(
+ empty_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
} else {
// Check isize::MAX is an OOM
// VecDeque starts with capacity 7, always adds 1 to the capacity
// and also rounds the number to next power of 2 so this is the
// furthest we can go without triggering CapacityOverflow
- if let Err(AllocError { .. }) =
- empty_bytes.try_reserve_exact(MAX_CAP).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve_exact(MAX_CAP).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
}
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
- } else {
- if let Err(AllocError { .. }) =
- ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
- }
- if let Err(CapacityOverflow) = ten_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind())
- {
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- panic!("usize::MAX should trigger an overflow!")
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_CAP - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
+ assert_matches!(
+ ten_bytes.try_reserve_exact(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
{
panic!("isize::MAX shouldn't trigger an overflow!");
}
if guards_against_isize {
- if let Err(CapacityOverflow) =
- ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an overflow!");
- }
- } else {
- if let Err(AllocError { .. }) =
- ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind())
- {
- } else {
- panic!("isize::MAX + 1 should trigger an OOM!")
- }
- }
- if let Err(CapacityOverflow) =
- ten_u32s.try_reserve_exact(MAX_USIZE - 20).map_err(|e| e.kind())
- {
+ assert_matches!(
+ ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "isize::MAX + 1 should trigger an overflow!"
+ );
} else {
- panic!("usize::MAX should trigger an overflow!")
+ assert_matches!(
+ ten_u32s.try_reserve_exact(MAX_CAP / 4 - 9).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "isize::MAX + 1 should trigger an OOM!"
+ );
}
+ assert_matches!(
+ ten_u32s.try_reserve_exact(MAX_USIZE - 20).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
}
}
macro_rules! impl_from {
($Small: ty, $Large: ty, #[$attr:meta], $doc: expr) => {
#[$attr]
- impl From<$Small> for $Large {
+ #[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
+ impl const From<$Small> for $Large {
// Rustdocs on the impl block show a "[+] show undocumented items" toggle.
// Rustdocs on functions do not.
#[doc = $doc]
macro_rules! try_from_unbounded {
($source:ty, $($target:ty),*) => {$(
#[stable(feature = "try_from", since = "1.34.0")]
- impl TryFrom<$source> for $target {
+ #[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
+ impl const TryFrom<$source> for $target {
type Error = TryFromIntError;
/// Try to create the target number type from a source
macro_rules! try_from_lower_bounded {
($source:ty, $($target:ty),*) => {$(
#[stable(feature = "try_from", since = "1.34.0")]
- impl TryFrom<$source> for $target {
+ #[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
+ impl const TryFrom<$source> for $target {
type Error = TryFromIntError;
/// Try to create the target number type from a source
macro_rules! try_from_upper_bounded {
($source:ty, $($target:ty),*) => {$(
#[stable(feature = "try_from", since = "1.34.0")]
- impl TryFrom<$source> for $target {
+ #[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
+ impl const TryFrom<$source> for $target {
type Error = TryFromIntError;
/// Try to create the target number type from a source
macro_rules! try_from_both_bounded {
($source:ty, $($target:ty),*) => {$(
#[stable(feature = "try_from", since = "1.34.0")]
- impl TryFrom<$source> for $target {
+ #[rustc_const_unstable(feature = "const_num_from_num", issue = "87852")]
+ impl const TryFrom<$source> for $target {
type Error = TryFromIntError;
/// Try to create the target number type from a source
/// backend used. Programs cannot rely on `black_box` for *correctness* in any way.
///
/// [`std::convert::identity`]: crate::convert::identity
-#[cfg_attr(not(miri), inline)]
-#[cfg_attr(miri, inline(never))]
+#[inline]
#[unstable(feature = "bench_black_box", issue = "64102")]
-#[cfg_attr(miri, allow(unused_mut))]
+#[cfg_attr(not(bootstrap), allow(unused_mut))]
pub fn black_box<T>(mut dummy: T) -> T {
- // We need to "use" the argument in some way LLVM can't introspect, and on
- // targets that support it we can typically leverage inline assembly to do
- // this. LLVM's interpretation of inline assembly is that it's, well, a black
- // box. This isn't the greatest implementation since it probably deoptimizes
- // more than we want, but it's so far good enough.
-
- #[cfg(not(miri))] // This is just a hint, so it is fine to skip in Miri.
+ #[cfg(bootstrap)]
// SAFETY: the inline assembly is a no-op.
unsafe {
- // FIXME: Cannot use `asm!` because it doesn't support MIPS and other architectures.
llvm_asm!("" : : "r"(&mut dummy) : "memory" : "volatile");
+ dummy
}
- dummy
+ #[cfg(not(bootstrap))]
+ {
+ crate::intrinsics::black_box(dummy)
+ }
}
/// which is UB if any of their inputs are `undef`.)
#[rustc_const_unstable(feature = "const_intrinsic_raw_eq", issue = "none")]
pub fn raw_eq<T>(a: &T, b: &T) -> bool;
+
+ /// See documentation of [`std::hint::black_box`] for details.
+ ///
+ /// [`std::hint::black_box`]: crate::hint::black_box
+ #[cfg(not(bootstrap))]
+ pub fn black_box<T>(dummy: T) -> T;
}
// Some functions are defined here because they accidentally got made
}
fn extend_one(&mut self, _item: ()) {}
}
+
+#[stable(feature = "extend_for_tuple", since = "1.56.0")]
+impl<A, B, ExtendA, ExtendB> Extend<(A, B)> for (ExtendA, ExtendB)
+where
+ ExtendA: Extend<A>,
+ ExtendB: Extend<B>,
+{
+ /// Allows to `extend` a tuple of collections that also implement `Extend`.
+ ///
+ /// See also: [`Iterator::unzip`]
+ ///
+ /// # Examples
+ /// ```
+ /// let mut tuple = (vec![0], vec![1]);
+ /// tuple.extend(vec![(2, 3), (4, 5), (6, 7)]);
+ /// assert_eq!(tuple.0, vec![0, 2, 4, 6]);
+ /// assert_eq!(tuple.1, vec![1, 3, 5, 7]);
+ ///
+ /// // also allows for arbitrarily nested tuples
+ /// let mut nested_tuple = (vec![(1, -1)], vec![(2, -2)]);
+ /// nested_tuple.extend(vec![((3, -3), (4, -4)), ((5, -5), (6, -6))]);
+ ///
+ /// assert_eq!(nested_tuple.0, vec![(1, -1), (3, -3), (5, -5)]);
+ /// assert_eq!(nested_tuple.1, vec![(2, -2), (4, -4), (6, -6)]);
+ /// ```
+ fn extend<T: IntoIterator<Item = (A, B)>>(&mut self, into_iter: T) {
+ let (a, b) = self;
+ let iter = into_iter.into_iter();
+
+ fn extend<'a, A, B>(
+ a: &'a mut impl Extend<A>,
+ b: &'a mut impl Extend<B>,
+ ) -> impl FnMut((), (A, B)) + 'a {
+ move |(), (t, u)| {
+ a.extend_one(t);
+ b.extend_one(u);
+ }
+ }
+
+ let (lower_bound, _) = iter.size_hint();
+ if lower_bound > 0 {
+ a.extend_reserve(lower_bound);
+ b.extend_reserve(lower_bound);
+ }
+
+ iter.fold((), extend(a, b));
+ }
+
+ fn extend_one(&mut self, item: (A, B)) {
+ self.0.extend_one(item.0);
+ self.1.extend_one(item.1);
+ }
+
+ fn extend_reserve(&mut self, additional: usize) {
+ self.0.extend_reserve(additional);
+ self.1.extend_reserve(additional);
+ }
+}
///
/// assert_eq!(left, [1, 3]);
/// assert_eq!(right, [2, 4]);
+ ///
+ /// // you can also unzip multiple nested tuples at once
+ /// let a = [(1, (2, 3)), (4, (5, 6))];
+ ///
+ /// let (x, (y, z)): (Vec<_>, (Vec<_>, Vec<_>)) = a.iter().cloned().unzip();
+ /// assert_eq!(x, [1, 4]);
+ /// assert_eq!(y, [2, 5]);
+ /// assert_eq!(z, [3, 6]);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
FromB: Default + Extend<B>,
Self: Sized + Iterator<Item = (A, B)>,
{
- fn extend<'a, A, B>(
- ts: &'a mut impl Extend<A>,
- us: &'a mut impl Extend<B>,
- ) -> impl FnMut((), (A, B)) + 'a {
- move |(), (t, u)| {
- ts.extend_one(t);
- us.extend_one(u);
- }
- }
-
- let mut ts: FromA = Default::default();
- let mut us: FromB = Default::default();
-
- let (lower_bound, _) = self.size_hint();
- if lower_bound > 0 {
- ts.extend_reserve(lower_bound);
- us.extend_reserve(lower_bound);
- }
-
- self.fold((), extend(&mut ts, &mut us));
-
- (ts, us)
+ let mut unzipped: (FromA, FromB) = Default::default();
+ unzipped.extend(self);
+ unzipped
}
/// Creates an iterator which copies all of its elements.
#![feature(const_slice_from_raw_parts)]
#![feature(const_slice_ptr_len)]
#![feature(const_swap)]
+#![feature(const_trait_impl)]
#![feature(const_type_id)]
#![feature(const_type_name)]
#![feature(const_unreachable_unchecked)]
}
}
+impl<T, U> Option<(T, U)> {
+ /// Unzips an option containing a tuple of two options
+ ///
+ /// If `self` is `Some((a, b))` this method returns `(Some(a), Some(b))`.
+ /// Otherwise, `(None, None)` is returned.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// #![feature(unzip_option)]
+ ///
+ /// let x = Some((1, "hi"));
+ /// let y = None::<(u8, u32)>;
+ ///
+ /// assert_eq!(x.unzip(), (Some(1), Some("hi")));
+ /// assert_eq!(y.unzip(), (None, None));
+ /// ```
+ #[inline]
+ #[unstable(feature = "unzip_option", issue = "87800", reason = "recently added")]
+ pub const fn unzip(self) -> (Option<T>, Option<U>) {
+ match self {
+ Some((a, b)) => (Some(a), Some(b)),
+ None => (None, None),
+ }
+ }
+}
+
impl<T: Copy> Option<&T> {
/// Maps an `Option<&T>` to an `Option<T>` by copying the contents of the
/// option.
-use crate::mem::{size_of, transmute_copy};
-use crate::ptr::write_bytes;
-
pub(super) trait SpecFill<T> {
fn spec_fill(&mut self, value: T);
}
impl<T: Copy> SpecFill<T> for [T] {
fn spec_fill(&mut self, value: T) {
- if size_of::<T>() == 1 {
- // SAFETY: The size_of check above ensures that values are 1 byte wide, as required
- // for the transmute and write_bytes
- unsafe {
- let value: u8 = transmute_copy(&value);
- write_bytes(self.as_mut_ptr(), value, self.len());
- }
- } else {
- for item in self.iter_mut() {
- *item = value;
- }
+ for item in self.iter_mut() {
+ *item = value;
}
}
}
#![feature(const_ptr_read)]
#![feature(const_ptr_write)]
#![feature(const_ptr_offset)]
+#![feature(const_trait_impl)]
+#![feature(const_num_from_num)]
#![feature(core_intrinsics)]
#![feature(core_private_bignum)]
#![feature(core_private_diy_float)]
#![feature(slice_group_by)]
#![feature(trusted_random_access)]
#![feature(unsize)]
+#![feature(unzip_option)]
#![deny(unsafe_op_in_unsafe_fn)]
extern crate test;
--- /dev/null
+#[test]
+fn from() {
+ use core::convert::TryFrom;
+ use core::num::TryFromIntError;
+
+ // From
+ const FROM: i64 = i64::from(1i32);
+ assert_eq!(FROM, 1i64);
+
+ // From int to float
+ const FROM_F64: f64 = f64::from(42u8);
+ assert_eq!(FROM_F64, 42f64);
+
+ // Upper bounded
+ const U8_FROM_U16: Result<u8, TryFromIntError> = u8::try_from(1u16);
+ assert_eq!(U8_FROM_U16, Ok(1u8));
+
+ // Both bounded
+ const I8_FROM_I16: Result<i8, TryFromIntError> = i8::try_from(1i16);
+ assert_eq!(I8_FROM_I16, Ok(1i8));
+
+ // Lower bounded
+ const I16_FROM_U16: Result<i16, TryFromIntError> = i16::try_from(1u16);
+ assert_eq!(I16_FROM_U16, Ok(1i16));
+}
mod u8;
mod bignum;
+
+mod const_from;
mod dec2flt;
mod flt2dec;
mod int_log;
}
#[test]
-pub fn option_ext() {
+fn option_ext() {
let thing = "{{ f }}";
let f = thing.find("{{");
println!("None!");
}
}
+
+#[test]
+fn zip_options() {
+ let x = Some(10);
+ let y = Some("foo");
+ let z: Option<usize> = None;
+
+ assert_eq!(x.zip(y), Some((10, "foo")));
+ assert_eq!(x.zip(z), None);
+ assert_eq!(z.zip(x), None);
+}
+
+#[test]
+fn unzip_options() {
+ let x = Some((10, "foo"));
+ let y = None::<(bool, i32)>;
+
+ assert_eq!(x.unzip(), (Some(10), Some("foo")));
+ assert_eq!(y.unzip(), (None, None));
+}
+
+#[test]
+fn zip_unzip_roundtrip() {
+ let x = Some(10);
+ let y = Some("foo");
+
+ let z = x.zip(y);
+ assert_eq!(z, Some((10, "foo")));
+
+ let a = z.unzip();
+ assert_eq!(a, (x, y));
+}
let v3: &[i32] = &[];
let c3 = v3.array_windows::<2>();
assert_eq!(c3.count(), 0);
+
+ let v4: &[()] = &[(); usize::MAX];
+ let c4 = v4.array_windows::<1>();
+ assert_eq!(c4.count(), usize::MAX);
}
#[test]
let v3: &[i32] = &[];
let c3 = v3.windows(2);
assert_eq!(c3.count(), 0);
+
+ let v4 = &[(); usize::MAX];
+ let c4 = v4.windows(1);
+ assert_eq!(c4.count(), usize::MAX);
}
#[test]
} else if #[cfg(any(
all(target_family = "windows", target_env = "gnu"),
target_os = "psp",
- target_family = "unix",
+ all(target_family = "unix", not(target_os = "espidf")),
all(target_vendor = "fortanix", target_env = "sgx"),
))] {
// Rust runtime's startup objects depend on these symbols, so make them public.
// - arch=wasm32
// - os=none ("bare metal" targets)
// - os=uefi
+ // - os=espidf
// - nvptx64-nvidia-cuda
// - arch=avr
#[path = "dummy.rs"]
panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
core = { path = "../core" }
-libc = { version = "0.2.98", default-features = false, features = ['rustc-dep-of-std'] }
+libc = { version = "0.2.99", default-features = false, features = ['rustc-dep-of-std'] }
compiler_builtins = { version = "0.1.44" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" }
|| target.contains("vxworks")
|| target.contains("wasm32")
|| target.contains("asmjs")
+ || target.contains("espidf")
{
// These platforms don't have any special requirements.
} else {
use super::Entry::{Occupied, Vacant};
use super::HashMap;
use super::RandomState;
+use crate::assert_matches::assert_matches;
use crate::cell::RefCell;
use rand::{thread_rng, Rng};
use realstd::collections::TryReserveErrorKind::*;
const MAX_USIZE: usize = usize::MAX;
- if let Err(CapacityOverflow) = empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()) {
- } else {
- panic!("usize::MAX should trigger an overflow!");
- }
-
- if let Err(AllocError { .. }) = empty_bytes.try_reserve(MAX_USIZE / 8).map_err(|e| e.kind()) {
- } else {
- panic!("usize::MAX / 8 should trigger an OOM!")
- }
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_USIZE).map_err(|e| e.kind()),
+ Err(CapacityOverflow),
+ "usize::MAX should trigger an overflow!"
+ );
+
+ assert_matches!(
+ empty_bytes.try_reserve(MAX_USIZE / 8).map_err(|e| e.kind()),
+ Err(AllocError { .. }),
+ "usize::MAX / 8 should trigger an OOM!"
+ );
}
#[test]
--- /dev/null
+#![stable(feature = "metadata_ext", since = "1.1.0")]
+
+use crate::fs::Metadata;
+use crate::sys_common::AsInner;
+
+#[allow(deprecated)]
+use crate::os::espidf::raw;
+
+/// OS-specific extensions to [`fs::Metadata`].
+///
+/// [`fs::Metadata`]: crate::fs::Metadata
+#[stable(feature = "metadata_ext", since = "1.1.0")]
+pub trait MetadataExt {
+ #[stable(feature = "metadata_ext", since = "1.1.0")]
+ #[rustc_deprecated(
+ since = "1.8.0",
+ reason = "deprecated in favor of the accessor \
+ methods of this trait"
+ )]
+ #[allow(deprecated)]
+ fn as_raw_stat(&self) -> &raw::stat;
+
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_dev(&self) -> u64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_ino(&self) -> u64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_mode(&self) -> u32;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_nlink(&self) -> u64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_uid(&self) -> u32;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_gid(&self) -> u32;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_rdev(&self) -> u64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_size(&self) -> u64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_atime(&self) -> i64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_atime_nsec(&self) -> i64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_mtime(&self) -> i64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_mtime_nsec(&self) -> i64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_ctime(&self) -> i64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_ctime_nsec(&self) -> i64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_blksize(&self) -> u64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_blocks(&self) -> u64;
+ #[stable(feature = "metadata_ext2", since = "1.8.0")]
+ fn st_spare4(&self) -> [u32; 2];
+}
+
+#[stable(feature = "metadata_ext", since = "1.1.0")]
+impl MetadataExt for Metadata {
+ #[allow(deprecated)]
+ fn as_raw_stat(&self) -> &raw::stat {
+ unsafe { &*(self.as_inner().as_inner() as *const libc::stat as *const raw::stat) }
+ }
+ fn st_dev(&self) -> u64 {
+ self.as_inner().as_inner().st_dev as u64
+ }
+ fn st_ino(&self) -> u64 {
+ self.as_inner().as_inner().st_ino as u64
+ }
+ fn st_mode(&self) -> u32 {
+ self.as_inner().as_inner().st_mode as u32
+ }
+ fn st_nlink(&self) -> u64 {
+ self.as_inner().as_inner().st_nlink as u64
+ }
+ fn st_uid(&self) -> u32 {
+ self.as_inner().as_inner().st_uid as u32
+ }
+ fn st_gid(&self) -> u32 {
+ self.as_inner().as_inner().st_gid as u32
+ }
+ fn st_rdev(&self) -> u64 {
+ self.as_inner().as_inner().st_rdev as u64
+ }
+ fn st_size(&self) -> u64 {
+ self.as_inner().as_inner().st_size as u64
+ }
+ fn st_atime(&self) -> i64 {
+ self.as_inner().as_inner().st_atime as i64
+ }
+ fn st_atime_nsec(&self) -> i64 {
+ 0
+ }
+ fn st_mtime(&self) -> i64 {
+ self.as_inner().as_inner().st_mtime as i64
+ }
+ fn st_mtime_nsec(&self) -> i64 {
+ 0
+ }
+ fn st_ctime(&self) -> i64 {
+ self.as_inner().as_inner().st_ctime as i64
+ }
+ fn st_ctime_nsec(&self) -> i64 {
+ 0
+ }
+ fn st_blksize(&self) -> u64 {
+ self.as_inner().as_inner().st_blksize as u64
+ }
+ fn st_blocks(&self) -> u64 {
+ self.as_inner().as_inner().st_blocks as u64
+ }
+ fn st_spare4(&self) -> [u32; 2] {
+ let spare4 = self.as_inner().as_inner().st_spare4;
+ [spare4[0] as u32, spare4[1] as u32]
+ }
+}
--- /dev/null
+//! Definitions for the ESP-IDF framework.
+
+#![stable(feature = "raw_ext", since = "1.1.0")]
+
+pub mod fs;
+pub mod raw;
--- /dev/null
+//! Raw type definitions for the ESP-IDF framework.
+
+#![stable(feature = "raw_ext", since = "1.1.0")]
+#![rustc_deprecated(
+ since = "1.8.0",
+ reason = "these type aliases are no longer supported by \
+ the standard library, the `libc` crate on \
+ crates.io should be used instead for the correct \
+ definitions"
+)]
+
+use crate::os::raw::c_long;
+use crate::os::unix::raw::{gid_t, uid_t};
+
+#[stable(feature = "pthread_t", since = "1.8.0")]
+pub type pthread_t = libc::pthread_t;
+
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type blkcnt_t = libc::blkcnt_t;
+
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type blksize_t = libc::blksize_t;
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type dev_t = libc::dev_t;
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type ino_t = libc::ino_t;
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type mode_t = libc::mode_t;
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type nlink_t = libc::nlink_t;
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type off_t = libc::off_t;
+
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub type time_t = libc::time_t;
+
+#[repr(C)]
+#[derive(Clone)]
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub struct stat {
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_dev: dev_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_ino: ino_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_mode: mode_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_nlink: nlink_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_uid: uid_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_gid: gid_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_rdev: dev_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_size: off_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_atime: time_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_mtime: time_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_ctime: time_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_blksize: blksize_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_blocks: blkcnt_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_spare4: [c_long; 2usize],
+}
pub mod dragonfly;
#[cfg(target_os = "emscripten")]
pub mod emscripten;
+ #[cfg(target_os = "espidf")]
+ pub mod espidf;
#[cfg(target_os = "freebsd")]
pub mod freebsd;
#[cfg(target_os = "fuchsia")]
pub use crate::os::dragonfly::*;
#[cfg(target_os = "emscripten")]
pub use crate::os::emscripten::*;
+ #[cfg(target_os = "espidf")]
+ pub use crate::os::espidf::*;
#[cfg(target_os = "freebsd")]
pub use crate::os::freebsd::*;
#[cfg(target_os = "fuchsia")]
target_arch = "asmjs",
target_arch = "wasm32",
target_arch = "hexagon",
- target_arch = "riscv32"
+ target_arch = "riscv32",
+ target_arch = "xtensa"
)))]
pub const MIN_ALIGN: usize = 8;
#[cfg(all(any(
target_os = "android",
target_os = "illumos",
target_os = "redox",
- target_os = "solaris"
+ target_os = "solaris",
+ target_os = "espidf"
))] {
#[inline]
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
Args { iter: res.into_iter() }
}
}
+
+#[cfg(target_os = "espidf")]
+mod imp {
+ use super::Args;
+
+ #[inline(always)]
+ pub unsafe fn init(_argc: isize, _argv: *const *const u8) {}
+
+ pub fn args() -> Args {
+ Args { iter: Vec::new().into_iter() }
+ }
+}
))]
pub unsafe fn init(&mut self) {}
+ // NOTE: ESP-IDF's PTHREAD_COND_INITIALIZER support is not released yet
+ // So on that platform, init() should always be called
+ // Moreover, that platform does not have pthread_condattr_setclock support,
+ // hence that initialization should be skipped as well
+ #[cfg(target_os = "espidf")]
+ pub unsafe fn init(&mut self) {
+ let r = libc::pthread_cond_init(self.inner.get(), crate::ptr::null());
+ assert_eq!(r, 0);
+ }
+
#[cfg(not(any(
target_os = "macos",
target_os = "ios",
target_os = "l4re",
target_os = "android",
- target_os = "redox"
+ target_os = "redox",
+ target_os = "espidf"
)))]
pub unsafe fn init(&mut self) {
use crate::mem::MaybeUninit;
// where we configure condition variable to use monotonic clock (instead of
// default system clock). This approach avoids all problems that result
// from changes made to the system time.
- #[cfg(not(any(target_os = "macos", target_os = "ios", target_os = "android")))]
+ #[cfg(not(any(
+ target_os = "macos",
+ target_os = "ios",
+ target_os = "android",
+ target_os = "espidf"
+ )))]
pub unsafe fn wait_timeout(&self, mutex: &Mutex, dur: Duration) -> bool {
use crate::mem;
// This implementation is modeled after libcxx's condition_variable
// https://github.com/llvm-mirror/libcxx/blob/release_35/src/condition_variable.cpp#L46
// https://github.com/llvm-mirror/libcxx/blob/release_35/include/__mutex_base#L367
- #[cfg(any(target_os = "macos", target_os = "ios", target_os = "android"))]
+ #[cfg(any(
+ target_os = "macos",
+ target_os = "ios",
+ target_os = "android",
+ target_os = "espidf"
+ ))]
pub unsafe fn wait_timeout(&self, mutex: &Mutex, mut dur: Duration) -> bool {
use crate::ptr;
use crate::time::Instant;
pub const EXE_SUFFIX: &str = "";
pub const EXE_EXTENSION: &str = "";
}
+
+#[cfg(target_os = "espidf")]
+pub mod os {
+ pub const FAMILY: &str = "unix";
+ pub const OS: &str = "espidf";
+ pub const DLL_PREFIX: &str = "lib";
+ pub const DLL_SUFFIX: &str = ".so";
+ pub const DLL_EXTENSION: &str = "so";
+ pub const EXE_SUFFIX: &str = "";
+ pub const EXE_EXTENSION: &str = "";
+}
Ok(ret as usize)
}
+ #[cfg(not(target_os = "espidf"))]
pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
let ret = cvt(unsafe {
libc::readv(
Ok(ret as usize)
}
+ #[cfg(target_os = "espidf")]
+ pub fn read_vectored(&self, bufs: &mut [IoSliceMut<'_>]) -> io::Result<usize> {
+ return crate::io::default_read_vectored(|b| self.read(b), bufs);
+ }
+
#[inline]
pub fn is_read_vectored(&self) -> bool {
- true
+ cfg!(not(target_os = "espidf"))
}
pub fn read_to_end(&self, buf: &mut Vec<u8>) -> io::Result<usize> {
Ok(ret as usize)
}
+ #[cfg(not(target_os = "espidf"))]
pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
let ret = cvt(unsafe {
libc::writev(
Ok(ret as usize)
}
+ #[cfg(target_os = "espidf")]
+ pub fn write_vectored(&self, bufs: &[IoSlice<'_>]) -> io::Result<usize> {
+ return crate::io::default_write_vectored(|b| self.write(b), bufs);
+ }
+
#[inline]
pub fn is_write_vectored(&self) -> bool {
- true
+ cfg!(not(target_os = "espidf"))
}
pub fn write_at(&self, buf: &[u8], offset: u64) -> io::Result<usize> {
}
}
#[cfg(any(
- target_env = "newlib",
+ all(target_env = "newlib", not(target_os = "espidf")),
target_os = "solaris",
target_os = "illumos",
target_os = "emscripten",
Ok(())
}
}
+ #[cfg(target_os = "espidf")]
+ pub fn set_cloexec(&self) -> io::Result<()> {
+ // FD_CLOEXEC is not supported in ESP-IDF but there's no need to,
+ // because ESP-IDF does not support spawning processes either.
+ Ok(())
+ }
#[cfg(target_os = "linux")]
pub fn set_nonblocking(&self, nonblocking: bool) -> io::Result<()> {
// We want to atomically duplicate this file descriptor and set the
// CLOEXEC flag, and currently that's done via F_DUPFD_CLOEXEC. This
// is a POSIX flag that was added to Linux in 2.6.24.
- let fd = cvt(unsafe { libc::fcntl(self.raw(), libc::F_DUPFD_CLOEXEC, 0) })?;
+ #[cfg(not(target_os = "espidf"))]
+ let cmd = libc::F_DUPFD_CLOEXEC;
+
+ // For ESP-IDF, F_DUPFD is used instead, because the CLOEXEC semantics
+ // will never be supported, as this is a bare metal framework with
+ // no capabilities for multi-process execution. While F_DUPFD is also
+ // not supported yet, it might be (currently it returns ENOSYS).
+ #[cfg(target_os = "espidf")]
+ let cmd = libc::F_DUPFD;
+
+ let fd = cvt(unsafe { libc::fcntl(self.raw(), cmd, 0) })?;
Ok(FileDesc::new(fd))
}
}
#[cfg(not(target_os = "netbsd"))]
impl FileAttr {
- #[cfg(not(target_os = "vxworks"))]
+ #[cfg(all(not(target_os = "vxworks"), not(target_os = "espidf")))]
pub fn modified(&self) -> io::Result<SystemTime> {
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_mtime as libc::time_t,
}))
}
- #[cfg(target_os = "vxworks")]
+ #[cfg(any(target_os = "vxworks", target_os = "espidf"))]
pub fn modified(&self) -> io::Result<SystemTime> {
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_mtime as libc::time_t,
}))
}
- #[cfg(not(target_os = "vxworks"))]
+ #[cfg(all(not(target_os = "vxworks"), not(target_os = "espidf")))]
pub fn accessed(&self) -> io::Result<SystemTime> {
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_atime as libc::time_t,
}))
}
- #[cfg(target_os = "vxworks")]
+ #[cfg(any(target_os = "vxworks", target_os = "espidf"))]
pub fn accessed(&self) -> io::Result<SystemTime> {
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_atime as libc::time_t,
target_os = "l4re",
target_os = "fuchsia",
target_os = "redox",
- target_os = "vxworks"
+ target_os = "vxworks",
+ target_os = "espidf"
))]
pub fn ino(&self) -> u64 {
self.entry.d_ino as u64
target_os = "emscripten",
target_os = "l4re",
target_os = "haiku",
- target_os = "vxworks"
+ target_os = "vxworks",
+ target_os = "espidf"
))]
fn name_bytes(&self) -> &[u8] {
unsafe { CStr::from_ptr(self.entry.d_name.as_ptr()).to_bytes() }
let original = cstr(original)?;
let link = cstr(link)?;
cfg_if::cfg_if! {
- if #[cfg(any(target_os = "vxworks", target_os = "redox", target_os = "android"))] {
- // VxWorks and Redox lack `linkat`, so use `link` instead. POSIX leaves
+ if #[cfg(any(target_os = "vxworks", target_os = "redox", target_os = "android", target_os = "espidf"))] {
+ // VxWorks, Redox and ESP-IDF lack `linkat`, so use `link` instead. POSIX leaves
// it implementation-defined whether `link` follows symlinks, so rely on the
// `symlink_hard_link` test in library/std/src/fs/tests.rs to check the behavior.
// Android has `linkat` on newer versions, but we happen to know `link`
Ok((reader, metadata))
}
+#[cfg(target_os = "espidf")]
+fn open_to_and_set_permissions(
+ to: &Path,
+ reader_metadata: crate::fs::Metadata,
+) -> io::Result<(crate::fs::File, crate::fs::Metadata)> {
+ use crate::fs::OpenOptions;
+ let writer = OpenOptions::new().open(to)?;
+ let writer_metadata = writer.metadata()?;
+ Ok((writer, writer_metadata))
+}
+
+#[cfg(not(target_os = "espidf"))]
fn open_to_and_set_permissions(
to: &Path,
reader_metadata: crate::fs::Metadata,
pub use self::rand::hashmap_random_keys;
pub use libc::strlen;
+#[cfg(not(target_os = "espidf"))]
#[macro_use]
pub mod weak;
pub mod thread_local_key;
pub mod time;
+#[cfg(target_os = "espidf")]
+pub fn init(argc: isize, argv: *const *const u8) {}
+
+#[cfg(not(target_os = "espidf"))]
// SAFETY: must be called only once during runtime initialization.
// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
pub unsafe fn init(argc: isize, argv: *const *const u8) {
extern "C" {}
}
}
+
+#[cfg(target_os = "espidf")]
+mod unsupported {
+ use crate::io;
+
+ pub fn unsupported<T>() -> io::Result<T> {
+ Err(unsupported_err())
+ }
+
+ pub fn unsupported_err() -> io::Error {
+ io::Error::new_const(
+ io::ErrorKind::Unsupported,
+ &"operation not supported on this platform",
+ )
+ }
+}
use crate::sys_common::{AsInner, FromInner, IntoInner};
use crate::time::{Duration, Instant};
-use libc::{c_int, c_void, size_t, sockaddr, socklen_t, EAI_SYSTEM, MSG_PEEK};
+use libc::{c_int, c_void, size_t, sockaddr, socklen_t, MSG_PEEK};
pub use crate::sys::{cvt, cvt_r};
// We may need to trigger a glibc workaround. See on_resolver_failure() for details.
on_resolver_failure();
- if err == EAI_SYSTEM {
+ #[cfg(not(target_os = "espidf"))]
+ if err == libc::EAI_SYSTEM {
return Err(io::Error::last_os_error());
}
+ #[cfg(not(target_os = "espidf"))]
let detail = unsafe {
str::from_utf8(CStr::from_ptr(libc::gai_strerror(err)).to_bytes()).unwrap().to_owned()
};
+
+ #[cfg(target_os = "espidf")]
+ let detail = "";
+
Err(io::Error::new(
io::ErrorKind::Uncategorized,
&format!("failed to lookup address information: {}", detail)[..],
}
}
+#[cfg(target_os = "espidf")]
+pub fn getcwd() -> io::Result<PathBuf> {
+ Ok(PathBuf::from("/"))
+}
+
+#[cfg(not(target_os = "espidf"))]
pub fn getcwd() -> io::Result<PathBuf> {
let mut buf = Vec::with_capacity(512);
loop {
}
}
+#[cfg(target_os = "espidf")]
+pub fn chdir(p: &path::Path) -> io::Result<()> {
+ super::unsupported::unsupported()
+}
+
+#[cfg(not(target_os = "espidf"))]
pub fn chdir(p: &path::Path) -> io::Result<()> {
let p: &OsStr = p.as_ref();
let p = CString::new(p.as_bytes())?;
path.canonicalize()
}
+#[cfg(target_os = "espidf")]
+pub fn current_exe() -> io::Result<PathBuf> {
+ super::unsupported::unsupported()
+}
+
pub struct Env {
iter: vec::IntoIter<(OsString, OsString)>,
}
}
}
+#[cfg(not(target_os = "espidf"))]
pub fn page_size() -> usize {
unsafe { libc::sysconf(libc::_SC_PAGESIZE) as usize }
}
target_os = "ios",
target_os = "emscripten",
target_os = "redox",
- target_os = "vxworks"
+ target_os = "vxworks",
+ target_os = "espidf"
))]
unsafe fn fallback() -> Option<OsString> {
None
target_os = "ios",
target_os = "emscripten",
target_os = "redox",
- target_os = "vxworks"
+ target_os = "vxworks",
+ target_os = "espidf"
)))]
unsafe fn fallback() -> Option<OsString> {
let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) {
} else if #[cfg(target_os = "vxworks")] {
#[path = "process_vxworks.rs"]
mod process_inner;
+ } else if #[cfg(target_os = "espidf")] {
+ #[path = "process_unsupported.rs"]
+ mod process_inner;
} else {
#[path = "process_unix.rs"]
mod process_inner;
--- /dev/null
+use crate::convert::{TryFrom, TryInto};
+use crate::fmt;
+use crate::io;
+use crate::io::ErrorKind;
+use crate::num::NonZeroI32;
+use crate::os::raw::NonZero_c_int;
+use crate::sys;
+use crate::sys::cvt;
+use crate::sys::pipe::AnonPipe;
+use crate::sys::process::process_common::*;
+use crate::sys::unix::unsupported::*;
+
+use libc::{c_int, pid_t};
+
+////////////////////////////////////////////////////////////////////////////////
+// Command
+////////////////////////////////////////////////////////////////////////////////
+
+impl Command {
+ pub fn spawn(
+ &mut self,
+ default: Stdio,
+ needs_stdin: bool,
+ ) -> io::Result<(Process, StdioPipes)> {
+ unsupported()
+ }
+
+ pub fn exec(&mut self, default: Stdio) -> io::Error {
+ unsupported_err()
+ }
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// Processes
+////////////////////////////////////////////////////////////////////////////////
+
+pub struct Process {
+ handle: pid_t,
+}
+
+impl Process {
+ pub fn id(&self) -> u32 {
+ 0
+ }
+
+ pub fn kill(&mut self) -> io::Result<()> {
+ unsupported()
+ }
+
+ pub fn wait(&mut self) -> io::Result<ExitStatus> {
+ unsupported()
+ }
+
+ pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> {
+ unsupported()
+ }
+}
+
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct ExitStatus(c_int);
+
+impl ExitStatus {
+ pub fn success(&self) -> bool {
+ self.code() == Some(0)
+ }
+
+ pub fn exit_ok(&self) -> Result<(), ExitStatusError> {
+ Err(ExitStatusError(1.try_into().unwrap()))
+ }
+
+ pub fn code(&self) -> Option<i32> {
+ None
+ }
+
+ pub fn signal(&self) -> Option<i32> {
+ None
+ }
+
+ pub fn core_dumped(&self) -> bool {
+ false
+ }
+
+ pub fn stopped_signal(&self) -> Option<i32> {
+ None
+ }
+
+ pub fn continued(&self) -> bool {
+ false
+ }
+
+ pub fn into_raw(&self) -> c_int {
+ 0
+ }
+}
+
+/// Converts a raw `c_int` to a type-safe `ExitStatus` by wrapping it without copying.
+impl From<c_int> for ExitStatus {
+ fn from(a: c_int) -> ExitStatus {
+ ExitStatus(a as i32)
+ }
+}
+
+impl fmt::Display for ExitStatus {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+ write!(f, "exit code: {}", self.0)
+ }
+}
+
+#[derive(PartialEq, Eq, Clone, Copy, Debug)]
+pub struct ExitStatusError(NonZero_c_int);
+
+impl Into<ExitStatus> for ExitStatusError {
+ fn into(self) -> ExitStatus {
+ ExitStatus(self.0.into())
+ }
+}
+
+impl ExitStatusError {
+ pub fn code(self) -> Option<NonZeroI32> {
+ ExitStatus(self.0.into()).code().map(|st| st.try_into().unwrap())
+ }
+}
unsafe { getrandom(buf.as_mut_ptr().cast(), buf.len(), libc::GRND_NONBLOCK) }
}
- #[cfg(not(any(target_os = "linux", target_os = "android")))]
+ #[cfg(target_os = "espidf")]
+ fn getrandom(buf: &mut [u8]) -> libc::ssize_t {
+ unsafe { libc::getrandom(buf.as_mut_ptr().cast(), buf.len(), 0) }
+ }
+
+ #[cfg(not(any(target_os = "linux", target_os = "android", target_os = "espidf")))]
fn getrandom_fill_bytes(_buf: &mut [u8]) -> bool {
false
}
- #[cfg(any(target_os = "linux", target_os = "android"))]
+ #[cfg(any(target_os = "linux", target_os = "android", target_os = "espidf"))]
fn getrandom_fill_bytes(v: &mut [u8]) -> bool {
use crate::sync::atomic::{AtomicBool, Ordering};
use crate::sys::os::errno;
#[cfg(any(target_os = "linux", target_os = "solaris", target_os = "illumos"))]
use crate::sys::weak::weak;
-#[cfg(not(any(target_os = "l4re", target_os = "vxworks")))]
+#[cfg(not(any(target_os = "l4re", target_os = "vxworks", target_os = "espidf")))]
pub const DEFAULT_MIN_STACK_SIZE: usize = 2 * 1024 * 1024;
#[cfg(target_os = "l4re")]
pub const DEFAULT_MIN_STACK_SIZE: usize = 1024 * 1024;
#[cfg(target_os = "vxworks")]
pub const DEFAULT_MIN_STACK_SIZE: usize = 256 * 1024;
+#[cfg(target_os = "espidf")]
+pub const DEFAULT_MIN_STACK_SIZE: usize = 0; // 0 indicates that the stack size configured in the ESP-IDF menuconfig system should be used
#[cfg(target_os = "fuchsia")]
mod zircon {
let mut attr: libc::pthread_attr_t = mem::zeroed();
assert_eq!(libc::pthread_attr_init(&mut attr), 0);
- let stack_size = cmp::max(stack, min_stack_size(&attr));
-
- match libc::pthread_attr_setstacksize(&mut attr, stack_size) {
- 0 => {}
- n => {
- assert_eq!(n, libc::EINVAL);
- // EINVAL means |stack_size| is either too small or not a
- // multiple of the system page size. Because it's definitely
- // >= PTHREAD_STACK_MIN, it must be an alignment issue.
- // Round up to the nearest page and try again.
- let page_size = os::page_size();
- let stack_size =
- (stack_size + page_size - 1) & (-(page_size as isize - 1) as usize - 1);
- assert_eq!(libc::pthread_attr_setstacksize(&mut attr, stack_size), 0);
- }
- };
+ #[cfg(target_os = "espidf")]
+ if stack > 0 {
+ // Only set the stack if a non-zero value is passed
+ // 0 is used as an indication that the default stack size configured in the ESP-IDF menuconfig system should be used
+ assert_eq!(
+ libc::pthread_attr_setstacksize(&mut attr, cmp::max(stack, min_stack_size(&attr))),
+ 0
+ );
+ }
+
+ #[cfg(not(target_os = "espidf"))]
+ {
+ let stack_size = cmp::max(stack, min_stack_size(&attr));
+
+ match libc::pthread_attr_setstacksize(&mut attr, stack_size) {
+ 0 => {}
+ n => {
+ assert_eq!(n, libc::EINVAL);
+ // EINVAL means |stack_size| is either too small or not a
+ // multiple of the system page size. Because it's definitely
+ // >= PTHREAD_STACK_MIN, it must be an alignment issue.
+ // Round up to the nearest page and try again.
+ let page_size = os::page_size();
+ let stack_size =
+ (stack_size + page_size - 1) & (-(page_size as isize - 1) as usize - 1);
+ assert_eq!(libc::pthread_attr_setstacksize(&mut attr, stack_size), 0);
+ }
+ };
+ }
let ret = libc::pthread_create(&mut native, &attr, thread_start, p as *mut _);
// Note: if the thread creation fails and this assert fails, then p will
// Newlib, Emscripten, and VxWorks have no way to set a thread name.
}
+ #[cfg(not(target_os = "espidf"))]
pub fn sleep(dur: Duration) {
let mut secs = dur.as_secs();
let mut nsecs = dur.subsec_nanos() as _;
}
}
+ #[cfg(target_os = "espidf")]
+ pub fn sleep(dur: Duration) {
+ let mut micros = dur.as_micros();
+ unsafe {
+ while micros > 0 {
+ let st = if micros > u32::MAX as u128 { u32::MAX } else { micros as u32 };
+ libc::usleep(st);
+
+ micros -= st as u128;
+ }
+ }
+ }
+
pub fn join(self) {
unsafe {
let ret = libc::pthread_join(self.id, ptr::null_mut());
}
}
- #[cfg(not(target_os = "dragonfly"))]
+ #[cfg(not(any(target_os = "dragonfly", target_os = "espidf")))]
pub type clock_t = libc::c_int;
- #[cfg(target_os = "dragonfly")]
+ #[cfg(any(target_os = "dragonfly", target_os = "espidf"))]
pub type clock_t = libc::c_ulong;
fn now(clock: clock_t) -> Timespec {
#[cfg(test)]
mod tests;
-use crate::borrow::Borrow;
use crate::cmp;
use crate::collections::BTreeMap;
use crate::convert::{TryFrom, TryInto};
utf16: Vec<u16>,
}
+impl EnvKey {
+ fn new<T: Into<OsString>>(key: T) -> Self {
+ EnvKey::from(key.into())
+ }
+}
+
// Comparing Windows environment variable keys[1] are behaviourally the
// composition of two operations[2]:
//
}
}
}
+impl PartialOrd<str> for EnvKey {
+ fn partial_cmp(&self, other: &str) -> Option<cmp::Ordering> {
+ Some(self.cmp(&EnvKey::new(other)))
+ }
+}
+impl PartialEq<str> for EnvKey {
+ fn eq(&self, other: &str) -> bool {
+ if self.os_string.len() != other.len() {
+ false
+ } else {
+ self.cmp(&EnvKey::new(other)) == cmp::Ordering::Equal
+ }
+ }
+}
// Environment variable keys should preserve their original case even though
// they are compared using a caseless string mapping.
}
}
-impl Borrow<OsStr> for EnvKey {
- fn borrow(&self) -> &OsStr {
- &self.os_string
+impl From<&OsStr> for EnvKey {
+ fn from(k: &OsStr) -> Self {
+ Self::from(k.to_os_string())
}
}
// to read the *child's* PATH if one is provided. See #15149 for more
// details.
let program = maybe_env.as_ref().and_then(|env| {
- if let Some(v) = env.get(OsStr::new("PATH")) {
+ if let Some(v) = env.get(&EnvKey::new("PATH")) {
// Split the value and test each path to see if the
// program exists.
for path in split_paths(&v) {
-pub const DEFAULT_BUF_SIZE: usize = 8 * 1024;
+// Bare metal platforms usually have very small amounts of RAM
+// (in the order of hundreds of KB)
+pub const DEFAULT_BUF_SIZE: usize = if cfg!(target_os = "espidf") { 512 } else { 8 * 1024 };
#[cfg(test)]
#[allow(dead_code)] // not used on emscripten
// The following functions build up changes
pub fn set(&mut self, key: &OsStr, value: &OsStr) {
+ let key = EnvKey::from(key);
self.maybe_saw_path(&key);
- self.vars.insert(key.to_owned().into(), Some(value.to_owned()));
+ self.vars.insert(key, Some(value.to_owned()));
}
pub fn remove(&mut self, key: &OsStr) {
+ let key = EnvKey::from(key);
self.maybe_saw_path(&key);
if self.clear {
- self.vars.remove(key);
+ self.vars.remove(&key);
} else {
- self.vars.insert(key.to_owned().into(), None);
+ self.vars.insert(key, None);
}
}
self.saw_path || self.clear
}
- fn maybe_saw_path(&mut self, key: &OsStr) {
+ fn maybe_saw_path(&mut self, key: &EnvKey) {
if !self.saw_path && key == "PATH" {
self.saw_path = true;
}
//! When the main thread of a Rust program terminates, the entire program shuts
//! down, even if other threads are still running. However, this module provides
//! convenient facilities for automatically waiting for the termination of a
-//! child thread (i.e., join).
+//! thread (i.e., join).
//!
//! ## Spawning a thread
//!
//! });
//! ```
//!
-//! In this example, the spawned thread is "detached" from the current
-//! thread. This means that it can outlive its parent (the thread that spawned
-//! it), unless this parent is the main thread.
+//! In this example, the spawned thread is "detached," which means that there is
+//! no way for the program to learn when the spawned thread completes or otherwise
+//! terminates.
//!
-//! The parent thread can also wait on the completion of the child
-//! thread; a call to [`spawn`] produces a [`JoinHandle`], which provides
-//! a `join` method for waiting:
+//! To learn when a thread completes, it is necessary to capture the [`JoinHandle`]
+//! object that is returned by the call to [`spawn`], which provides
+//! a `join` method that allows the caller to wait for the completion of the
+//! spawned thread:
//!
//! ```rust
//! use std::thread;
//!
-//! let child = thread::spawn(move || {
+//! let thread_join_handle = thread::spawn(move || {
//! // some work here
//! });
//! // some work here
-//! let res = child.join();
+//! let res = thread_join_handle.join();
//! ```
//!
//! The [`join`] method returns a [`thread::Result`] containing [`Ok`] of the final
-//! value produced by the child thread, or [`Err`] of the value given to
-//! a call to [`panic!`] if the child panicked.
+//! value produced by the spawned thread, or [`Err`] of the value given to
+//! a call to [`panic!`] if the thread panicked.
+//!
+//! Note that there is no parent/child relationship between a thread that spawns a
+//! new thread and the thread being spawned. In particular, the spawned thread may or
+//! may not outlive the spawning thread, unless the spawning thread is the main thread.
//!
//! ## Configuring threads
//!
//! A new thread can be configured before it is spawned via the [`Builder`] type,
-//! which currently allows you to set the name and stack size for the child thread:
+//! which currently allows you to set the name and stack size for the thread:
//!
//! ```rust
//! # #![allow(unused_must_use)]
//! use std::thread;
//!
-//! thread::Builder::new().name("child1".to_string()).spawn(move || {
+//! thread::Builder::new().name("thread1".to_string()).spawn(move || {
//! println!("Hello, world!");
//! });
//! ```
/// The spawned thread may outlive the caller (unless the caller thread
/// is the main thread; the whole process is terminated when the main
/// thread finishes). The join handle can be used to block on
- /// termination of the child thread, including recovering its panics.
+ /// termination of the spawned thread, including recovering its panics.
///
/// For a more complete documentation see [`thread::spawn`][`spawn`].
///
/// The spawned thread may outlive the caller (unless the caller thread
/// is the main thread; the whole process is terminated when the main
/// thread finishes). The join handle can be used to block on
- /// termination of the child thread, including recovering its panics.
+ /// termination of the spawned thread, including recovering its panics.
///
/// This method is identical to [`thread::Builder::spawn`][`Builder::spawn`],
/// except for the relaxed lifetime bounds, which render it unsafe.
/// Spawns a new thread, returning a [`JoinHandle`] for it.
///
-/// The join handle will implicitly *detach* the child thread upon being
-/// dropped. In this case, the child thread may outlive the parent (unless
-/// the parent thread is the main thread; the whole process is terminated when
-/// the main thread finishes). Additionally, the join handle provides a [`join`]
-/// method that can be used to join the child thread. If the child thread
-/// panics, [`join`] will return an [`Err`] containing the argument given to
-/// [`panic!`].
+/// The join handle provides a [`join`] method that can be used to join the spawned
+/// thread. If the spawned thread panics, [`join`] will return an [`Err`] containing
+/// the argument given to [`panic!`].
+///
+/// If the join handle is dropped, the spawned thread will implicitly be *detached*.
+/// In this case, the spawned thread may no longer be joined.
+/// (It is the responsibility of the program to either eventually join threads it
+/// creates or detach them; otherwise, a resource leak will result.)
///
-/// This will create a thread using default parameters of [`Builder`], if you
+/// This call will create a thread using default parameters of [`Builder`], if you
/// want to specify the stack size or the name of the thread, use this API
/// instead.
///
///
/// - The `'static` constraint means that the closure and its return value
/// must have a lifetime of the whole program execution. The reason for this
-/// is that threads can `detach` and outlive the lifetime they have been
-/// created in.
+/// is that threads can outlive the lifetime they have been created in.
+///
/// Indeed if the thread, and by extension its return value, can outlive their
/// caller, we need to make sure that they will be valid afterwards, and since
/// we *can't* know when it will return we need to have them valid as long as
#[stable(feature = "rust1", since = "1.0.0")]
pub type Result<T> = crate::result::Result<T, Box<dyn Any + Send + 'static>>;
-// This packet is used to communicate the return value between the child thread
-// and the parent thread. Memory is shared through the `Arc` within and there's
+// This packet is used to communicate the return value between the spawned thread
+// and the rest of the program. Memory is shared through the `Arc` within and there's
// no need for a mutex here because synchronization happens with `join()` (the
-// parent thread never reads this packet until the child has exited).
+// caller will never read this packet until the thread has exited).
//
// This packet itself is then stored into a `JoinInner` which in turns is placed
// in `JoinHandle` and `JoinGuard`. Due to the usage of `UnsafeCell` we need to
/// }).unwrap();
/// ```
///
-/// Child being detached and outliving its parent:
+/// A thread being detached and outliving the thread that spawned it:
///
/// ```no_run
/// use std::thread;
/// Waits for the associated thread to finish.
///
+ /// This function will return immediately if the associated thread has already finished.
+ ///
/// In terms of [atomic memory orderings], the completion of the associated
/// thread synchronizes with this function returning. In other words, all
- /// operations performed by that thread are ordered before all
+ /// operations performed by that thread [happen
+ /// before](https://doc.rust-lang.org/nomicon/atomics.html#data-accesses) all
/// operations that happen after `join` returns.
///
- /// If the child thread panics, [`Err`] is returned with the parameter given
+ /// If the associated thread panics, [`Err`] is returned with the parameter given
/// to [`panic!`].
///
/// [`Err`]: crate::result::Result::Err
} else if #[cfg(any(
target_os = "l4re",
target_os = "none",
+ target_os = "espidf",
))] {
// These "unix" family members do not have unwinder.
// Note this also matches x86_64-unknown-none-linuxkernel.
-Subproject commit a07036f864b37896b31eb996cd7aedb489f69a1f
+Subproject commit 7e49659102f0977d9142190e1ba23345c0f00eb1
-Subproject commit 09986cd352404eb4659db44613b27cac9aa652fc
+Subproject commit 4f9fcaa30d11ba52b641e6fd5206536d65838af9
-Subproject commit f51734eb5566c826b471977747ea3d7d6915bbe9
+Subproject commit 0c7e5bd1428e7838252bb57b7f0fbfda4ec82f02
-Subproject commit 3b7be075af5d6e402a18efff672a8a265b4596fd
+Subproject commit 4884fe45c14f8b22121760fb117181bb4da8dfe0
-Subproject commit 09343d6f921d2a07c66f8c41ec3d65bf1fa52556
+Subproject commit c4644b427cbdaafc7a87be0ccdf5d8aaa07ac35f
target | std | notes
-------|:---:|-------
`aarch64-apple-ios` | ✓ | ARM64 iOS
+[`aarch64-apple-ios-sim`](platform-support/aarch64-apple-ios-sim.md) | ✓ | Apple iOS Simulator on ARM64
`aarch64-fuchsia` | ✓ | ARM64 Fuchsia
`aarch64-linux-android` | ✓ | ARM64 Android
`aarch64-unknown-none-softfloat` | * | Bare ARM64, softfloat
`wasm32-unknown-unknown` | ✓ | WebAssembly
`wasm32-wasi` | ✓ | WebAssembly with WASI
`x86_64-apple-ios` | ✓ | 64-bit x86 iOS
-[`aarch64-apple-ios-sim`](platform-support/aarch64-apple-ios-sim.md) | ✓ | | Apple iOS Simulator on ARM64
`x86_64-fortanix-unknown-sgx` | ✓ | [Fortanix ABI] for 64-bit Intel SGX
`x86_64-fuchsia` | ✓ | 64-bit Fuchsia
`x86_64-linux-android` | ✓ | 64-bit x86 Android
`powerpc64le-unknown-linux-musl` | ? | |
`riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33)
`riscv32gc-unknown-linux-musl` | | | RISC-V Linux (kernel 5.4, musl + RISCV32 support patches)
+`riscv32imc-esp-espidf` | ✓ | | RISC-V ESP-IDF
`riscv64gc-unknown-linux-musl` | | | RISC-V Linux (kernel 4.20, musl 1.2.0)
`s390x-unknown-linux-musl` | | | S390x Linux (kernel 2.6.32, MUSL)
`sparc-unknown-linux-gnu` | ✓ | | 32-bit SPARC Linux
## Attributes
-There are a few annotations that are useful to help `rustdoc` do the right
+Code blocks can be annotated with attributes that help `rustdoc` do the right
thing when testing your code:
+The `ignore` attribute tells Rust to ignore your code. This is almost never
+what you want as it's the most generic. Instead, consider annotating it
+with `text` if it's not code or using `#`s to get a working example that
+only shows the part you care about.
+
```rust
/// ```ignore
/// fn foo() {
# fn foo() {}
```
-The `ignore` directive tells Rust to ignore your code. This is almost never
-what you want, as it's the most generic. Instead, consider annotating it
-with `text` if it's not code, or using `#`s to get a working example that
-only shows the part you care about.
+`should_panic` tells `rustdoc` that the code should compile correctly but
+panic during execution. If the code doesn't panic, the test will fail.
```rust
/// ```should_panic
# fn foo() {}
```
-`should_panic` tells `rustdoc` that the code should compile correctly, but
-not actually pass as a test.
+The `no_run` attribute will compile your code but not run it. This is
+important for examples such as "Here's how to retrieve a web page,"
+which you would want to ensure compiles, but might be run in a test
+environment that has no network access.
```rust
/// ```no_run
# fn foo() {}
```
-The `no_run` attribute will compile your code, but not run it. This is
-important for examples such as "Here's how to retrieve a web page,"
-which you would want to ensure compiles, but might be run in a test
-environment that has no network access.
+`compile_fail` tells `rustdoc` that the compilation should fail. If it
+compiles, then the test will fail. However, please note that code failing
+with the current Rust release may work in a future release, as new features
+are added.
-```text
+```rust
/// ```compile_fail
/// let x = 5;
/// x += 2; // shouldn't compile!
/// ```
+# fn foo() {}
```
-`compile_fail` tells `rustdoc` that the compilation should fail. If it
-compiles, then the test will fail. However please note that code failing
-with the current Rust release may work in a future release, as new features
-are added.
+`edition2018` tells `rustdoc` that the code sample should be compiled using
+the 2018 edition of Rust. Similarly, you can specify `edition2015` to compile
+the code with the 2015 edition.
-```text
+```rust
/// Only runs on the 2018 edition.
///
/// ```edition2018
/// + "3".parse::<i32>()?
/// };
/// ```
+# fn foo() {}
```
-`edition2018` tells `rustdoc` that the code sample should be compiled using
-the 2018 edition of Rust. Similarly, you can specify `edition2015` to compile
-the code with the 2015 edition.
-
## Syntax reference
The *exact* syntax for code blocks, including the edge cases, can be found
However, it's preferable to use fenced code blocks over indented code blocks.
Not only are fenced code blocks considered more idiomatic for Rust code,
-but there is no way to use directives such as `ignore` or `should_panic` with
+but there is no way to use attributes such as `ignore` or `should_panic` with
indented code blocks.
### Include items only when collecting doctests
+++ /dev/null
-# `plugin_registrar`
-
-The tracking issue for this feature is: [#29597]
-
-[#29597]: https://github.com/rust-lang/rust/issues/29597
-
-This feature is part of "compiler plugins." It will often be used with the
-[`plugin`] and `rustc_private` features as well. For more details, see
-their docs.
-
-[`plugin`]: plugin.md
-
-------------------------
This feature is part of "compiler plugins." It will often be used with the
-[`plugin_registrar`] and `rustc_private` features.
-
-[`plugin_registrar`]: plugin-registrar.md
+`rustc_private` feature.
------------------------
that warns about any item named `lintme`.
```rust,ignore (requires-stage-2)
-#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
extern crate rustc_ast;
}
}
-#[plugin_registrar]
-pub fn plugin_registrar(reg: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&TEST_LINT]);
reg.lint_store.register_early_pass(|| box Pass);
}
.docblock code {
color: #ffb454;
}
-h3 > code, h4 > code, h5 > code {
+.code-header {
color: #e6e1cf;
}
pre > code {
A(u32),
B(u32),
}
-// CHECK: %Align64 = type { [0 x i32], i32, [15 x i32] }
+// CHECK: %Align64 = type { i32, [15 x i32] }
pub struct Nested64 {
a: u8,
#[repr(align(64))]
pub struct Align64(i32);
-// CHECK: %Align64 = type { [0 x i32], i32, [15 x i32] }
+// CHECK: %Align64 = type { i32, [15 x i32] }
pub struct Nested64 {
a: Align64,
c: i32,
d: i8,
}
-// CHECK: %Nested64 = type { [0 x i64], %Align64, [0 x i32], i32, [0 x i32], i32, [0 x i8], i8, [55 x i8] }
+// CHECK: %Nested64 = type { %Align64, i32, i32, i8, [55 x i8] }
pub enum Enum4 {
A(i32),
B(i32),
}
-// CHECK: %"Enum4::A" = type { [1 x i32], i32, [0 x i32] }
+// CHECK: %"Enum4::A" = type { [1 x i32], i32 }
pub enum Enum64 {
A(Align64),
B(i32),
}
-// CHECK: %Enum64 = type { [0 x i32], i32, [31 x i32] }
-// CHECK: %"Enum64::A" = type { [8 x i64], %Align64, [0 x i64] }
+// CHECK: %Enum64 = type { i32, [31 x i32] }
+// CHECK: %"Enum64::A" = type { [8 x i64], %Align64 }
// CHECK-LABEL: @align64
#[no_mangle]
--- /dev/null
+// Make sure that no 0-sized padding is inserted in structs and that
+// structs are represented as expected by Neon intrinsics in LLVM.
+// See #87254.
+
+#![crate_type = "lib"]
+#![feature(repr_simd)]
+
+#[derive(Copy, Clone, Debug)]
+#[repr(simd)]
+pub struct int16x4_t(pub i16, pub i16, pub i16, pub i16);
+
+#[derive(Copy, Clone, Debug)]
+pub struct int16x4x2_t(pub int16x4_t, pub int16x4_t);
+// CHECK: %int16x4x2_t = type { <4 x i16>, <4 x i16> }
help: insert some indirection (e.g., a `DEF_ID` representable
|
LL | This(Box<E>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `f::E` representable
|
LL | V(Box<E>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `E` representable
|
LL | V(Box<E>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@true]
- | ^^^^
+ | ++++
help: to link to the builtin type, prefix with `prim@`
|
LL | /// [prim@true]
- | ^^^^^
+ | +++++
error: `ambiguous` is both a struct and a function
--> $DIR/ambiguity.rs:27:7
help: to link to the struct, prefix with `struct@`
|
LL | /// [`struct@ambiguous`] is ambiguous.
- | ^^^^^^^
+ | +++++++
help: to link to the function, add parentheses
|
LL | /// [`ambiguous()`] is ambiguous.
- | ^^
+ | ++
error: `ambiguous` is both a struct and a function
--> $DIR/ambiguity.rs:29:6
help: to link to the struct, prefix with `struct@`
|
LL | /// [struct@ambiguous] is ambiguous.
- | ^^^^^^^
+ | +++++++
help: to link to the function, add parentheses
|
LL | /// [ambiguous()] is ambiguous.
- | ^^
+ | ++
error: `multi_conflict` is a struct, a function, and a macro
--> $DIR/ambiguity.rs:31:7
help: to link to the struct, prefix with `struct@`
|
LL | /// [`struct@multi_conflict`] is a three-way conflict.
- | ^^^^^^^
+ | +++++++
help: to link to the function, add parentheses
|
LL | /// [`multi_conflict()`] is a three-way conflict.
- | ^^
+ | ++
help: to link to the macro, add an exclamation mark
|
LL | /// [`multi_conflict!`] is a three-way conflict.
- | ^
+ | +
error: `type_and_value` is both a module and a constant
--> $DIR/ambiguity.rs:33:16
help: to link to the module, prefix with `mod@`
|
LL | /// Ambiguous [mod@type_and_value].
- | ^^^^
+ | ++++
help: to link to the constant, prefix with `const@`
|
LL | /// Ambiguous [const@type_and_value].
- | ^^^^^^
+ | ++++++
error: `foo::bar` is both an enum and a function
--> $DIR/ambiguity.rs:35:43
help: to link to the enum, prefix with `enum@`
|
LL | /// Ambiguous non-implied shortcut link [`enum@foo::bar`].
- | ^^^^^
+ | +++++
help: to link to the function, add parentheses
|
LL | /// Ambiguous non-implied shortcut link [`foo::bar()`].
- | ^^
+ | ++
error: aborting due to 6 previous errors
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
- | ^^^^^
+ | ~~~~~
error: incompatible link kind for `S`
--> $DIR/disambiguator-mismatch.rs:21:14
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
- | ^^^^^
+ | ~~~~~
error: incompatible link kind for `S`
--> $DIR/disambiguator-mismatch.rs:26:14
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
- | ^^^^^
+ | ~~~~~
error: incompatible link kind for `S`
--> $DIR/disambiguator-mismatch.rs:31:14
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
- | ^^^^^
+ | ~~~~~
error: incompatible link kind for `T`
--> $DIR/disambiguator-mismatch.rs:36:14
help: to link to the trait, prefix with `trait@`
|
LL | /// Link to [trait@T]
- | ^^^^^^
+ | ~~~~~~
error: incompatible link kind for `m`
--> $DIR/disambiguator-mismatch.rs:41:14
|
help: to link to the macro, add an exclamation mark
|
-LL | /// Link to [m!]
- | --^
+LL - /// Link to [derive@m]
+LL + /// Link to [m!]
+ |
error: unresolved link to `m`
--> $DIR/disambiguator-mismatch.rs:46:14
help: to link to the macro, add an exclamation mark
|
LL | /// Link to [m!()]
- | ^
+ | +
error: incompatible link kind for `s`
--> $DIR/disambiguator-mismatch.rs:52:14
help: to link to the static, prefix with `static@`
|
LL | /// Link to [static@s]
- | ^^^^^^^
+ | ~~~~~~~
error: incompatible link kind for `c`
--> $DIR/disambiguator-mismatch.rs:57:14
help: to link to the constant, prefix with `const@`
|
LL | /// Link to [const@c]
- | ^^^^^^
+ | ~~~~~~
error: incompatible link kind for `c`
--> $DIR/disambiguator-mismatch.rs:62:14
help: to link to the constant, prefix with `const@`
|
LL | /// Link to [const@c]
- | ^^^^^^
+ | ~~~~~~
error: incompatible link kind for `c`
--> $DIR/disambiguator-mismatch.rs:67:14
|
help: to link to the constant, prefix with `const@`
|
-LL | /// Link to [const@c]
- | ^^^^^^--
+LL - /// Link to [c()]
+LL + /// Link to [const@c]
+ |
error: incompatible link kind for `f`
--> $DIR/disambiguator-mismatch.rs:72:14
|
help: to link to the function, add parentheses
|
-LL | /// Link to [f()]
- | --^^
+LL - /// Link to [const@f]
+LL + /// Link to [f()]
+ |
error: aborting due to 12 previous errors
|
help: to link to the associated function, add parentheses
|
-LL | /// [Vec::into_iter()]
- | -- ^^
+LL - /// [type@Vec::into_iter]
+LL + /// [Vec::into_iter()]
+ |
error: unresolved link to `S`
--> $DIR/errors.rs:68:6
|
help: to link to the struct, prefix with `struct@`
|
-LL | /// [struct@S]
- | ^^^^^^^--
+LL - /// [S!]
+LL + /// [struct@S]
+ |
error: unresolved link to `S::h`
--> $DIR/errors.rs:78:6
|
help: to link to the associated function, add parentheses
|
-LL | /// [S::h()]
- | -- ^^
+LL - /// [type@S::h]
+LL + /// [S::h()]
+ |
error: unresolved link to `T::g`
--> $DIR/errors.rs:86:6
|
help: to link to the associated function, add parentheses
|
-LL | /// [T::g()]
- | -- ^^
+LL - /// [type@T::g]
+LL + /// [T::g()]
+ |
error: unresolved link to `T::h`
--> $DIR/errors.rs:91:6
help: to link to the macro, add an exclamation mark
|
LL | /// [m!()]
- | ^
+ | +
error: aborting due to 20 previous errors
help: to link to the field, remove the disambiguator
|
LL | /// [`Foo::bar`]
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: to link to the associated constant, prefix with `const@`
|
LL | //! [const@u8::MIN]
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
- | ^^^^
+ | ++++
help: to link to the builtin type, prefix with `prim@`
|
LL | /// [prim@char]
- | ^^^^^
+ | +++++
error: `char` is both a module and a builtin type
--> $DIR/prim-conflict.rs:10:6
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
- | ^^^^
+ | ~~~~
help: to link to the builtin type, prefix with `prim@`
|
LL | /// [prim@char]
- | ^^^^^
+ | ~~~~~
error: incompatible link kind for `char`
--> $DIR/prim-conflict.rs:19:6
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
- | ^^^^
+ | ~~~~
error: incompatible link kind for `char`
--> $DIR/prim-conflict.rs:26:10
help: to link to the builtin type, prefix with `prim@`
|
LL | //! [prim@char]
- | ^^^^^
+ | ~~~~~
error: aborting due to 4 previous errors
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
- | ^^^^^^^
+ | ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:9:5
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
- | ^^^^^^^
+ | ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:21:5
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
- | ^^^^^^^
+ | ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:35:5
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
- | ^^^^^^^
+ | ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:92:9
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
- | ^^^^^^^
+ | ~~~~~~~
warning: 12 warnings emitted
|
help: you might have forgotten to add the struct literal inside the block
|
-LL | fn foo() { SomeStruct {
+LL ~ fn foo() { SomeStruct {
LL | Input: 123
-LL | } }
+LL ~ } }
|
error: aborting due to previous error
// force-host
-#![feature(plugin_registrar)]
#![feature(rustc_private)]
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
-#[plugin_registrar]
-pub fn plugin_registrar(_: &mut Registry) {}
+#[no_mangle]
+fn __rustc_plugin_registrar(_: &mut Registry) {}
-#![feature(box_syntax, plugin, plugin_registrar, rustc_private)]
+#![feature(box_syntax, plugin, rustc_private)]
#![crate_type = "dylib"]
extern crate rustc_ast_pretty;
extern crate rustc_driver;
extern crate rustc_hir;
-#[macro_use]
extern crate rustc_lint;
#[macro_use]
extern crate rustc_session;
use rustc_hir as hir;
use rustc_hir::intravisit;
use rustc_hir::Node;
-use rustc_lint::{LateContext, LateLintPass, LintArray, LintContext, LintPass};
+use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_span::source_map;
-#[plugin_registrar]
-pub fn plugin_registrar(reg: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&MISSING_ALLOWED_ATTR]);
reg.lint_store.register_late_pass(|| box MissingAllowedAttrPass);
}
// force-host
-#![feature(plugin_registrar, rustc_private)]
+#![feature(rustc_private)]
#![feature(box_syntax)]
extern crate rustc_driver;
Symbol::intern("crate_grey"), Symbol::intern("crate_green")
}
-#[plugin_registrar]
-pub fn plugin_registrar(reg: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[
&CRATE_NOT_OKAY,
&CRATE_NOT_RED,
// force-host
-#![feature(plugin_registrar, rustc_private)]
+#![feature(rustc_private)]
#![feature(box_syntax)]
extern crate rustc_driver;
}
}
-#[plugin_registrar]
-pub fn plugin_registrar(reg: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&CRATE_NOT_OKAY]);
reg.lint_store.register_late_pass(|| box Pass);
}
// force-host
-#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
// Load rustc as a plugin to get macros.
}
}
-#[plugin_registrar]
-pub fn plugin_registrar(reg: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&TEST_LINT, &PLEASE_LINT]);
reg.lint_store.register_late_pass(|| box Pass);
reg.lint_store.register_group(
// force-host
-#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
extern crate rustc_ast;
}
}
-#[plugin_registrar]
-pub fn plugin_registrar(reg: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&TEST_LINT]);
reg.lint_store.register_early_pass(|| box Pass);
}
-#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
extern crate rustc_ast;
}
}
-#[plugin_registrar]
-pub fn plugin_registrar(reg: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(reg: &mut Registry) {
reg.lint_store.register_lints(&[&TEST_RUSTC_TOOL_LINT, &TEST_LINT, &TEST_GROUP]);
reg.lint_store.register_early_pass(|| box Pass);
reg.lint_store.register_group(
// force-host
-#![feature(plugin_registrar)]
#![feature(rustc_private)]
extern crate rustc_middle;
use rustc_driver::plugin::Registry;
-#[plugin_registrar]
-pub fn plugin_registrar(_reg: &mut Registry) {}
+#[no_mangle]
+fn __rustc_plugin_registrar(_reg: &mut Registry) {}
--- /dev/null
+#![crate_type = "dylib"]
+#![feature(rustc_private)]
+
+extern crate rustc_middle;
+extern crate rustc_driver;
+
+use rustc_driver::plugin::Registry;
+
+#[no_mangle]
+fn __rustc_plugin_registrar(_: &mut Registry) {}
--- /dev/null
+#![crate_type = "dylib"]
+#![feature(rustc_private)]
+
+extern crate rustc_middle;
+extern crate rustc_driver;
+
+use rustc_driver::plugin::Registry;
+
+#[no_mangle]
+fn __rustc_plugin_registrar(_: &mut Registry) {}
// force-host
-#![feature(plugin_registrar)]
#![feature(box_syntax, rustc_private)]
extern crate rustc_middle;
fn drop(&mut self) {}
}
-#[plugin_registrar]
-pub fn registrar(_: &mut Registry) {
+#[no_mangle]
+fn __rustc_plugin_registrar(_: &mut Registry) {
thread_local!(static FOO: RefCell<Option<Box<Any+Send>>> = RefCell::new(None));
FOO.with(|s| *s.borrow_mut() = Some(box Foo { foo: 10 } as Box<Any+Send>));
}
// no-prefer-dynamic
#![crate_type = "rlib"]
-#![feature(plugin_registrar, rustc_private)]
+#![feature(rustc_private)]
extern crate rustc_middle;
extern crate rustc_driver;
use rustc_driver::plugin::Registry;
-#[plugin_registrar]
-pub fn plugin_registrar(_: &mut Registry) {}
+#[no_mangle]
+fn __rustc_plugin_registrar(_: &mut Registry) {}
--- /dev/null
+// run-pass
+// aux-build:multiple-plugins-1.rs
+// aux-build:multiple-plugins-2.rs
+
+// Check that the plugin registrar of multiple plugins doesn't conflict
+
+#![feature(plugin)]
+#![plugin(multiple_plugins_1)] //~ WARN use of deprecated attribute `plugin`
+#![plugin(multiple_plugins_2)] //~ WARN use of deprecated attribute `plugin`
+
+fn main() {}
--- /dev/null
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
+ --> $DIR/multiple-plugins.rs:8:1
+ |
+LL | #![plugin(multiple_plugins_1)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
+ |
+ = note: `#[warn(deprecated)]` on by default
+
+warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
+ --> $DIR/multiple-plugins.rs:9:1
+ |
+LL | #![plugin(multiple_plugins_2)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
+
+warning: 2 warnings emitted
+
help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: i32);
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo(i32: TypeName);
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(_: i32);
- | ^^^^^^
+ | ~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:9:29
help: if this is a `self` type, give it a parameter name
|
LL | fn foo_with_ref(self: &mut i32);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo_with_ref(i32: &mut TypeName);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo_with_ref(_: &mut i32);
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:12:47
help: explicitly ignore the parameter name
|
LL | fn foo_with_qualified_path(_: <Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:15:56
help: explicitly ignore the parameter name
|
LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:18:57
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:18:74
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:22:36
help: if this is a `self` type, give it a parameter name
|
LL | fn bar_with_default_impl(self: String, String) {}
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String: TypeName, String) {}
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar_with_default_impl(_: String, String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:22:44
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String, String: TypeName) {}
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar_with_default_impl(String, _: String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:27:22
help: if this is a parameter name, give it a type
|
LL | fn baz(a:usize, b: TypeName, c: usize) -> usize {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn baz(a:usize, _: b, c: usize) -> usize {
- | ^^^^
+ | ~~~~
error: aborting due to 9 previous errors
help: disambiguate the associated constant for candidate #1
|
LL | const X: i32 = Foo::ID;
- | ^^^^^^^
+ | ~~~~~
help: disambiguate the associated constant for candidate #2
|
LL | const X: i32 = Bar::ID;
- | ^^^^^^^
+ | ~~~~~
error: aborting due to previous error
impl Thing for AssocNoCopy {
type Out = Box<dyn Bar<Assoc: Copy>>;
- //~^ ERROR the trait bound `String: Copy` is not satisfied
fn func() -> Self::Out {
+ //~^ ERROR the trait bound `String: Copy` is not satisfied
Box::new(AssocNoCopy)
}
}
error[E0277]: the trait bound `String: Copy` is not satisfied
- --> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:30:28
+ --> $DIR/assoc-type-eq-with-dyn-atb-fail.rs:32:18
|
-LL | type Out = Box<dyn Bar<Assoc: Copy>>;
- | ^^^^^^^^^^^ the trait `Copy` is not implemented for `String`
+LL | fn func() -> Self::Out {
+ | ^^^^^^^^^ the trait `Copy` is not implemented for `String`
error: aborting due to previous error
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:43
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:93
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 3 previous errors
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::A as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<<Self as Foo>::Out as Baz>::Assoc: Default` is not satisfied
--> $DIR/bounds-on-assoc-in-trait.rs:35:38
help: consider further restricting the associated type
|
LL | pub trait Foo where <<Self as Foo>::Out as Baz>::Assoc: Default { type Out: Baz<Assoc: Default>; }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 2 previous errors
help: borrowed types always have a statically known size
|
LL | enum E1 { V(&dyn Iterator<Item: Copy>) }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) }
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:16:13
help: borrowed types always have a statically known size
|
LL | enum E3 { V(&dyn Iterator<Item: 'static>) }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | enum E3 { V(Box<dyn Iterator<Item: 'static>>) }
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:20:15
help: borrowed types always have a statically known size
|
LL | union U1 { f: &dyn Iterator<Item: Copy> }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | union U1 { f: Box<dyn Iterator<Item: Copy>> }
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:25:15
help: borrowed types always have a statically known size
|
LL | union U3 { f: &dyn Iterator<Item: 'static> }
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | union U3 { f: Box<dyn Iterator<Item: 'static>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to 13 previous errors
= note: `#[warn(type_alias_bounds)]` on by default
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere1<T> = T;
- | --
+LL - type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
+LL + type _TaWhere1<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:6:25
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere2<T> = T;
- | --
+LL - type _TaWhere2<T> where T: Iterator<Item: 'static> = T;
+LL + type _TaWhere2<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:7:25
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere3<T> = T;
- | --
+LL - type _TaWhere3<T> where T: Iterator<Item: 'static> = T;
+LL + type _TaWhere3<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:8:25
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere4<T> = T;
- | --
+LL - type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T;
+LL + type _TaWhere4<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:9:25
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere5<T> = T;
- | --
+LL - type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T;
+LL + type _TaWhere5<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:10:25
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type _TaWhere6<T> = T;
- | --
+LL - type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T;
+LL + type _TaWhere6<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:12:20
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline1<T> = T;
- | --
+LL - type _TaInline1<T: Iterator<Item: Copy>> = T;
+LL + type _TaInline1<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:13:20
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline2<T> = T;
- | --
+LL - type _TaInline2<T: Iterator<Item: 'static>> = T;
+LL + type _TaInline2<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:14:20
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline3<T> = T;
- | --
+LL - type _TaInline3<T: Iterator<Item: 'static>> = T;
+LL + type _TaInline3<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:15:20
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline4<T> = T;
- | --
+LL - type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T;
+LL + type _TaInline4<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:16:20
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline5<T> = T;
- | --
+LL - type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T;
+LL + type _TaInline5<T> = T;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:17:20
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type _TaInline6<T> = T;
- | --
+LL - type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T;
+LL + type _TaInline6<T> = T;
+ |
warning: 12 warnings emitted
help: use fully qualified syntax to disambiguate
|
LL | fn a<C:Vehicle+Box>(_: <C as Box>::Color) {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn a<C:Vehicle+Box>(_: <C as Vehicle>::Color) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:20:12
help: use fully qualified syntax to disambiguate
|
LL | fn b<C>(_: <C as Box>::Color) where C : Vehicle+Box {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn b<C>(_: <C as Vehicle>::Color) where C : Vehicle+Box {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:24:12
help: use fully qualified syntax to disambiguate
|
LL | fn c<C>(_: <C as Box>::Color) where C : Vehicle, C : Box {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn c<C>(_: <C as Vehicle>::Color) where C : Vehicle, C : Box {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20
help: use fully qualified syntax to disambiguate
|
LL | fn e(&self, _: <X as Box>::Color) where X : Box;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn e(&self, _: <X as Vehicle>::Color) where X : Box;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20
help: use fully qualified syntax to disambiguate
|
LL | fn f(&self, _: <X as Box>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn f(&self, _: <X as Vehicle>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20
help: use fully qualified syntax to disambiguate
|
LL | fn d(&self, _: <X as Box>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn d(&self, _: <X as Vehicle>::Color) where X : Box { }
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
help: use fully qualified syntax to disambiguate
|
LL | fn dent<C:BoxCar>(c: C, color: <C as Vehicle>::Color) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn dent<C:BoxCar>(c: C, color: <C as Box>::Color) {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0222]: ambiguous associated type `Color` in bounds of `BoxCar`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:37
help: use fully qualified syntax to disambiguate
|
LL | fn paint<C:BoxCar>(c: C, d: <C as Vehicle>::Color) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn paint<C:BoxCar>(c: C, d: <C as Box>::Color) {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0191]: the value of the associated types `Color` (from trait `Box`), `Color` (from trait `Vehicle`) must be specified
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32
help: consider further restricting the associated type
|
LL | where G : GetToInt, <G as GetToInt>::R: ToInt
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++
error: aborting due to previous error
help: a type parameter with a similar name exists
|
LL | let _: I = x.boo();
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn foo2<I: Foo, A>(x: I) {
- | ^^^
+ | +++
error: aborting due to previous error
help: consider constraining the associated type `<I as Foo>::A` to `Bar`
|
LL | fn foo2<I: Foo<A = Bar>>(x: I) {
- | ^^^^^^^^^
+ | +++++++++
error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
--> $DIR/associated-types-eq-3.rs:38:5
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error: aborting due to previous error
help: consider further restricting this bound
|
LL | fn f<T:Foo<isize> + Foo<usize>>(t: &T) {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to previous error
help: consider constraining the associated type `<T as Foo>::Y` to `i32`
|
LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
- | ^^^^^^^^^
+ | +++++++++
error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
--> $DIR/associated-types-multiple-types-one-trait.rs:18:5
help: consider constraining the associated type `<T as Foo>::X` to `u32`
|
LL | fn have_y_want_x<T:Foo<Y=i32, X = u32>>(t: &T)
- | ^^^^^^^^^
+ | +++++++++
error: aborting due to 2 previous errors
help: consider restricting type parameter `T`
|
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
- | ^^^^^
+ | +++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error[E0277]: the trait bound `(T, U): Get` is not satisfied
--> $DIR/associated-types-no-suitable-supertrait.rs:22:40
help: use fully qualified syntax to disambiguate
|
LL | pub fn f2<T: Foo + Bar>(a: T, x: <T as Bar>::A) {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | pub fn f2<T: Foo + Bar>(a: T, x: <T as Foo>::A) {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: aborting due to 2 previous errors
help: change the type of the numeric literal from `i32` to `u32`
|
LL | f1(2i32, 4u32);
- | ^^^^
+ | ~~~~
error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:29:5
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
LL | let _: i32 = f2(2i32).try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
|
help: use a fully qualified path with explicit lifetimes
|
-LL | struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
-LL | field: <I as Foo<&'a isize>>::A
+LL ~ struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
+LL ~ field: <I as Foo<&'a isize>>::A
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
help: use a fully qualified path with explicit lifetimes
|
-LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
-LL | TupleVariant(<I as Foo<&'c isize>>::A),
+LL ~ enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
+LL ~ TupleVariant(<I as Foo<&'c isize>>::A),
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
help: use a fully qualified path with explicit lifetimes
|
-LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
+LL ~ enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
LL | TupleVariant(I::A),
LL |
-LL | StructVariant { field: <I as Foo<&'c isize>>::A },
+LL ~ StructVariant { field: <I as Foo<&'c isize>>::A },
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
|
help: use a fully qualified path with explicit lifetimes
|
-LL | struct Why<'bb, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
+LL ~ struct Why<'bb, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
LL | 'y, 'z, 'aa, I: for<'l, 'm> Foo<&'l &'m isize>> {
-LL | field: <I as Foo<&'bb &'bb isize>>::A,
+LL ~ field: <I as Foo<&'bb &'bb isize>>::A,
|
error: aborting due to 4 previous errors
help: consider further restricting `Self`
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get;
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error: aborting due to previous error
help: consider further restricting the associated type
|
LL | fn foo<T:Get>(t: T) where <T as Get>::Value: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++
error: aborting due to previous error
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | fn elision<T: for<'a> Fn() -> &'a i32>() {
- | ^^^^^^^ ^^^
+ | +++++++ ~~~
help: consider using the `'static` lifetime
|
LL | fn elision<T: Fn() -> &'static i32>() {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | fn elision(_: for<'a> fn() -> &'a i32) {
- | ^^^^^^^ ^^^
+ | +++++++ ~~~
help: consider using the `'static` lifetime
|
LL | fn elision(_: fn() -> &'static i32) {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B == _`
- --> $DIR/defaults-cyclic-fail-1.rs:26:5
+ --> $DIR/defaults-cyclic-fail-1.rs:26:14
|
LL | type A = Box<Self::B>;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A == _`
- --> $DIR/defaults-cyclic-fail-1.rs:32:5
+ --> $DIR/defaults-cyclic-fail-1.rs:32:14
|
LL | type B = &'static Self::A;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
error[E0275]: overflow evaluating the requirement `<bool as Tr>::B == _`
- --> $DIR/defaults-cyclic-fail-2.rs:27:5
+ --> $DIR/defaults-cyclic-fail-2.rs:27:14
|
LL | type A = Box<Self::B>;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^
error[E0275]: overflow evaluating the requirement `<usize as Tr>::A == _`
- --> $DIR/defaults-cyclic-fail-2.rs:33:5
+ --> $DIR/defaults-cyclic-fail-2.rs:33:14
|
LL | type B = &'static Self::A;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
error: aborting due to 2 previous errors
help: consider restricting type parameter `T`
|
LL | trait Foo<T: std::clone::Clone> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `(): Foo<Self>` is not satisfied
--> $DIR/defaults-suitability.rs:34:5
help: consider further restricting the associated type
|
LL | trait Foo2<T> where <Self as Foo2<T>>::Baz: Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:74:5
help: consider further restricting the associated type
|
LL | trait Foo25<T: Clone> where <Self as Foo25<T>>::Baz: Clone {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:87:5
help: consider further restricting type parameter `T`
|
LL | Self::Baz: Clone, T: std::clone::Clone
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 8 previous errors
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::fmt::Display {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-1.rs:20:5
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:5
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Deref {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:5
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Copy {
- | ^^^^^^
+ | ++++++
error: aborting due to 4 previous errors
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::fmt::Display {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-2.rs:20:5
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:5
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Deref {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:5
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Copy {
- | ^^^^^^
+ | ++++++
error: aborting due to 4 previous errors
help: consider restricting type parameter `T`
|
LL | impl<S, T: for<'b> X<'b, T>> X<'_, T> for (S,) {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to 2 previous errors
help: consider further restricting the associated type
|
LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T where for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 2 previous errors
help: consider constraining the associated type `<impl Bar as Foo>::Item` to `i32`
|
LL | fn bar() -> impl Bar<Item = i32> {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self>, Self: Sized {
- | ^^^^^^^^^^^^^
+ | +++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | trait From<Src: ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
help: specify the associated types
|
LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
help: consider restricting type parameter `T`
|
LL | pub fn copy_any<T: std::marker::Copy>(t: &T) -> T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Complete for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider further restricting the associated type
|
LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | trait MyTrait: Sized {
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
help: consider constraining the associated type `<A as Trait>::Associated` to `()`
|
LL | A: Trait<Associated = ()> + 'static,
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:59:5
help: consider constraining the associated type `<C as Trait>::Associated` to `()`
|
LL | C: Trait<Associated = ()> + Foo,
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:65:5
help: consider constraining the associated type `<E as GenericTrait<()>>::Associated` to `()`
|
LL | E: GenericTrait<(), Associated = ()> + 'static,
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:71:5
help: consider constraining the associated type `<F as GenericTrait<()>>::Associated` to `()`
|
LL | F: GenericTrait<(), Associated = ()> + Foo,
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:74:5
help: consider constraining the associated type `<impl Trait as Trait>::Associated` to `()`
|
LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:82:5
help: consider constraining the associated type `<impl DerivedTrait as Trait>::Associated` to `()`
|
LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<impl Trait+Foo as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:85:5
help: consider constraining the associated type `<impl Trait+Foo as Trait>::Associated` to `()`
|
LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<impl DerivedTrait+Foo as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:88:5
help: consider constraining the associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` to `()`
|
LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:94:5
help: consider constraining the associated type `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated` to `()`
|
LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()>+GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:97:5
help: specify the associated types
|
LL | type Foo<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs, Output = Type> + Y<Rhs, A = Type>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:15:32
help: specify the associated types
|
LL | type Bar<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs> + Z<Rhs, A = Type, B = Type, Output = Type>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:18:32
help: specify the associated types
|
LL | type Baz<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Y<Rhs, A = Type>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:21:32
help: specify the associated types
|
LL | type Bat<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Fine<Rhs>;
- | ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
error[E0191]: the value of the associated types `Output` (from trait `Div`), `Output` (from trait `Mul`) must be specified
--> $DIR/missing-associated-types.rs:24:21
help: consider further restricting `Self`
|
LL | trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> + Sized {}
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
help: to force the async block to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | Box::new(async move { x } )
- | ^^^^
+ | ++++
error[E0373]: async block may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/async-borrowck-escaping-block-error.rs:11:11
help: to force the async block to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | async move { *x }
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | Box::new((async move || x)())
- | ^^^^
+ | ++++
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:7:20
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:22
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:29
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
help: you can escape reserved keywords to use them as identifiers
|
LL | struct Foo { r#await: () }
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:16:15
help: you can escape reserved keywords to use them as identifiers
|
LL | impl Foo { fn r#await() {} }
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:19:14
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 7 previous errors
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:6:20
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:22
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:29
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:12:14
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await { () => {}; }
- | ^^^^^^^
+ | ~~~~~~~
error: expected expression, found `)`
--> $DIR/2018-edition-error.rs:15:12
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: consider `await`ing on the `Future`
|
LL | foo().await?;
- | ^^^^^^
+ | ++++++
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/issue-61076.rs:67:5
help: consider `await`ing on the `Future`
|
LL | t.await?;
- | ^^^^^^
+ | ++++++
error[E0609]: no field `0` on type `impl Future`
--> $DIR/issue-61076.rs:78:26
help: consider `await`ing on the `Future` and access the field of its `Output`
|
LL | let _: i32 = tuple().await.0;
- | ^^^^^^
+ | ++++++
error[E0609]: no field `a` on type `impl Future`
--> $DIR/issue-61076.rs:82:28
help: consider `await`ing on the `Future` and access the field of its `Output`
|
LL | let _: i32 = struct_().await.a;
- | ^^^^^^
+ | ++++++
error[E0599]: no method named `method` found for opaque type `impl Future` in the current scope
--> $DIR/issue-61076.rs:86:15
help: consider `await`ing on the `Future` and calling the method on its `Output`
|
LL | struct_().await.method();
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/issue-61076.rs:94:9
help: consider `await`ing on the `Future`
|
LL | match tuple().await {
- | ^^^^^^
+ | ++++++
error: aborting due to 6 previous errors
help: consider restricting type parameter `U`
|
LL | fn foo<T: Send, U: std::marker::Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | async fn frob(&self) {}
- | ^
+ | +
error: aborting due to 3 previous errors
help: consider further restricting type parameter `T`
|
LL | where 'me:'async_trait, T: std::marker::Sync {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
help: to force the closure to take ownership of `self` (and any other referenced variables), use the `move` keyword
|
LL | foo(move || self.bar()).await;
- | ^^^^
+ | ++++
error[E0521]: borrowed data escapes outside of associated function
--> $DIR/issue-62097.rs:13:9
help: consider using the `'a` lifetime
|
LL | ) -> &'a dyn Foo
- | ^^^
+ | ~~~
error: aborting due to previous error
help: add missing generic argument
|
LL | async fn copy() -> Result<(), E>
- | ^^^
+ | +++
error[E0282]: type annotations needed
--> $DIR/issue-65159.rs:8:5
help: to force the async block to take ownership of `room_ref` (and any other referenced variables), use the `move` keyword
|
LL | let gameloop_handle = spawn(async move {
- | ^^^^
+ | ++++
error: aborting due to previous error
help: consider wrapping the receiver expression with the appropriate type
|
LL | Pin::new(&mut self.sleep).poll(cx)
- | ^^^^^^^^^^^^^ ^
+ | +++++++++++++ +
error: aborting due to previous error
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/suggest-missing-await.rs:22:5
help: consider `await`ing on the `Future`
|
LL | dummy().await
- | ^^^^^^
+ | ++++++
help: consider using a semicolon here
|
LL | dummy();
- | ^
+ | +
error: aborting due to 2 previous errors
help: if you meant to use the UTF-8 encoding of 'ffi', use \xHH escapes
|
LL | #[rustc_dummy = b"/xEF/xAC/x83.rs"]
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
help: `%` can be used on `{integer}`, you can dereference `x`
|
LL | *x % 2 == 0
- | ^
+ | +
error: aborting due to previous error
help: consider further restricting this bound
|
LL | fn add<A: Add<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:8:10
help: consider restricting type parameter `B`
|
LL | fn add<A: Add<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:13:10
help: consider further restricting this bound
|
LL | fn sub<A: Sub<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:14:10
help: consider restricting type parameter `B`
|
LL | fn sub<A: Sub<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:19:10
help: consider further restricting this bound
|
LL | fn mul<A: Mul<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:20:10
help: consider restricting type parameter `B`
|
LL | fn mul<A: Mul<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:25:10
help: consider further restricting this bound
|
LL | fn div<A: Div<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:26:10
help: consider restricting type parameter `B`
|
LL | fn div<A: Div<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:31:10
help: consider further restricting this bound
|
LL | fn rem<A: Rem<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:32:10
help: consider restricting type parameter `B`
|
LL | fn rem<A: Rem<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:37:10
help: consider further restricting this bound
|
LL | fn bitand<A: BitAnd<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:38:10
help: consider restricting type parameter `B`
|
LL | fn bitand<A: BitAnd<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:43:10
help: consider further restricting this bound
|
LL | fn bitor<A: BitOr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:44:10
help: consider restricting type parameter `B`
|
LL | fn bitor<A: BitOr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:49:10
help: consider further restricting this bound
|
LL | fn bitxor<A: BitXor<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:50:10
help: consider restricting type parameter `B`
|
LL | fn bitxor<A: BitXor<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:55:10
help: consider further restricting this bound
|
LL | fn shl<A: Shl<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:56:10
help: consider restricting type parameter `B`
|
LL | fn shl<A: Shl<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:61:10
help: consider further restricting this bound
|
LL | fn shr<A: Shr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:62:10
help: consider restricting type parameter `B`
|
LL | fn shr<A: Shr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
- | ^^^^^^
+ | ++++++
error: aborting due to 20 previous errors
help: consider further restricting this bound
|
LL | fn double_move<T: Add<Output=()> + Copy>(x: T) {
- | ^^^^^^
+ | ++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/binop-move-semantics.rs:14:5
help: consider further restricting this bound
|
LL | fn move_then_borrow<T: Add<Output=()> + Clone + Copy>(x: T) {
- | ^^^^^^
+ | ++++++
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/binop-move-semantics.rs:21:5
help: you can use `as` to change the binding name of the import
|
LL | use foo::Bar as OtherBar;
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use foo::foo as other_foo;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
found reference `&_`
help: consider removing the borrow
|
-LL | panic!()
- | --
+LL - &panic!()
+LL + panic!()
+ |
error: aborting due to previous error
help: consider using a semicolon here
|
LL | foo();
- | ^
+ | +
help: try adding a return type
|
LL | fn bar() -> usize {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
LL | spawn(move || books.push(4));
- | ^^^^
+ | ++++
error: aborting due to previous error
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
LL | Box::new(move || books.push(4))
- | ^^^^
+ | ++++
error: aborting due to previous error
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the `&`
|
-LL | [Foo { string: a },
-LL | Foo { string: b }] => {
+LL ~ [Foo { string: a },
+LL ~ Foo { string: b }] => {
|
error: aborting due to previous error
help: consider further restricting this bound
|
LL | fn c<F:FnOnce(isize, isize) -> isize + Copy>(f: F) {
- | ^^^^^^
+ | ++++++
error: aborting due to 3 previous errors
|
help: consider removing the `&mut`
|
-LL | [_a,
-LL |
-LL |
-LL |
-LL | ..
-LL | ] => {
+LL ~ [_a,
+LL +
+LL +
+LL +
+LL + ..
+LL ~ ] => {
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
|
help: consider removing the `&mut`
|
-LL | [
-LL |
-LL | _b] => {}
+LL ~ [
+LL +
+LL ~ _b] => {}
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
help: borrow this field in the pattern to avoid moving `maybe.0`
|
LL | if let Some(ref thing) = maybe {
- | ^^^
+ | +++
error: aborting due to previous error
help: add missing generic argument
|
LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_, T> {
- | ^^^
+ | +++
error[E0515]: cannot return value referencing temporary value
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:19:5
help: borrow this field in the pattern to avoid moving `opt.0`
|
LL | if let Some(ref mut _x) = opt {}
- | ^^^
+ | +++
error: aborting due to previous error
help: borrow this field in the pattern to avoid moving `s.0`
|
LL | if let Some(ref mut x) = s {
- | ^^^
+ | +++
error[E0382]: use of partially moved value: `e`
--> $DIR/move-in-pattern-mut.rs:22:9
help: borrow this field in the pattern to avoid moving `e.s`
|
LL | let E::V { s: ref mut x } = e;
- | ^^^
+ | +++
error: aborting due to 2 previous errors
help: borrow this field in the pattern to avoid moving `s.0`
|
LL | if let Some(ref x) = s {
- | ^^^
+ | +++
error[E0382]: use of partially moved value: `e`
--> $DIR/move-in-pattern.rs:23:9
help: borrow this field in the pattern to avoid moving `e.s`
|
LL | let E::V { s: ref x } = e;
- | ^^^
+ | +++
error: aborting due to 2 previous errors
help: consider creating a fresh reborrow of `value` here
|
LL | Other::handle(&mut *value);
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: consider further restricting this bound
|
LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:15:22
help: consider restricting type parameter `T`
|
LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:21:22
help: consider further restricting this bound
|
LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `Y` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:27:30
help: consider further restricting type parameter `Y`
|
LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:33:22
help: consider further restricting this bound
|
LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:39:22
help: consider further restricting type parameter `X`
|
LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: std::fmt::Debug {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:44:46
help: consider further restricting `Self`
|
LL | trait Foo<T>: Sized {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:49:46
help: consider further restricting `Self`
|
LL | trait Bar: std::fmt::Display + Sized {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:54:46
help: consider further restricting `Self`
|
LL | trait Baz: Sized where Self: std::fmt::Display {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:59:46
help: consider further restricting `Self`
|
LL | trait Qux<T>: Sized where Self: std::fmt::Display {
- | ^^^^^^^
+ | +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:64:46
help: consider further restricting `Self`
|
LL | trait Bat<T>: std::fmt::Display + Sized {
- | ^^^^^^^
+ | +++++++
error: aborting due to 11 previous errors
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for (T,) { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/builtin-superkinds-double-superkind.rs:9:16
help: consider further restricting this bound
|
LL | impl <T: Send + std::marker::Sync> Foo for (T,T) { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 2 previous errors
help: consider further restricting this bound
|
LL | impl <T:Sync+'static + std::marker::Send> RequiresRequiresShareAndSend for X<T> { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for T { }
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: a trait with a similar name exists
|
LL | self , ... , self , self , ... ) where Fn : FnOnce ( & 'a & 'b usize ) {
- | ^^
+ | ~~
help: you might be missing a type parameter
|
LL | fn ordering4 < 'a , 'b, F > ( a : , self , self , self ,
- | ^^^
+ | +++
error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references
--> $DIR/issue-86053-1.rs:11:52
help: consider using the `'static` lifetime
|
LL | ) -> &'static usize {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider borrowing the value
|
LL | let _pointer_to_something = &something as *const Something;
- | ^
+ | +
error[E0605]: non-primitive cast: `Something` as `*mut Something`
--> $DIR/issue-84213.rs:14:37
help: consider borrowing the value
|
LL | let _mut_pointer_to_something = &mut something as *mut Something;
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
help: to force the closure to take ownership of `p` (and any other referenced variables), use the `move` keyword
|
LL | let mut c = move || {
- | ^^^^
+ | ++++
error: aborting due to previous error
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr` to be fully captured
|
-LL | thread::spawn(move || { let _ = &fptr; unsafe {
-LL |
-LL |
-LL |
-LL |
-LL | *fptr.0 = 20;
+LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
+LL +
+LL +
+LL +
+LL +
+LL + *fptr.0 = 20;
...
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr` to be fully captured
|
-LL | thread::spawn(move || { let _ = &fptr; unsafe {
-LL |
-LL |
-LL |
-LL |
-LL | *fptr.0.0 = 20;
+LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
+LL +
+LL +
+LL +
+LL +
+LL + *fptr.0.0 = 20;
...
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f` to be fully captured
|
-LL | let c = || { let _ = &f;
-LL |
-LL |
-LL |
-LL |
-LL | let f_1 = f.1;
+LL ~ let c = || { let _ = &f;
+LL +
+LL +
+LL +
+LL +
+LL + let f_1 = f.1;
...
error: aborting due to 3 previous errors
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
|
-LL | let c = || { let _ = (&t, &t1, &t2);
-LL |
-LL |
-LL |
-LL |
-LL | let _t = t.0;
+LL ~ let c = || { let _ = (&t, &t1, &t2);
+LL +
+LL +
+LL +
+LL +
+LL + let _t = t.0;
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1` to be fully captured
|
-LL | let c = || { let _ = (&t, &t1);
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = (&t, &t1);
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t1`, `t` to be fully captured
|
-LL | let c = move || { let _ = (&t1, &t);
-LL |
-LL |
-LL |
-LL | println!("{} {}", t1.1, t.1);
-LL |
+LL ~ let c = move || { let _ = (&t1, &t);
+LL +
+LL +
+LL +
+LL + println!("{} {}", t1.1, t.1);
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: aborting due to 7 previous errors
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = move || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.1;
-LL |
+LL ~ let c = move || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.1;
+LL +
...
error: aborting due to 2 previous errors
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t; t.0 };
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f` to be fully captured
|
-LL | let result = panic::catch_unwind(move || { let _ = &f;
-LL |
-LL |
-LL |
-LL |
-LL | f.0()
+LL ~ let result = panic::catch_unwind(move || { let _ = &f;
+LL +
+LL +
+LL +
+LL +
+LL + f.0()
...
error: aborting due to previous error
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1`, `f2` to be fully captured
|
-LL | let c = || { let _ = (&f1, &f2);
-LL |
-LL |
-LL |
-LL |
-LL | let _f_1 = f1.0;
+LL ~ let c = || { let _ = (&f1, &f2);
+LL +
+LL +
+LL +
+LL +
+LL + let _f_1 = f1.0;
...
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1` to be fully captured
|
-LL | let c = || { let _ = &f1;
-LL |
-LL |
-LL |
-LL |
-LL | let _f_1 = f1.0;
+LL ~ let c = || { let _ = &f1;
+LL +
+LL +
+LL +
+LL +
+LL + let _f_1 = f1.0;
...
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1` to be fully captured
|
-LL | let c = || { let _ = &f1;
-LL |
-LL |
-LL |
-LL |
-LL |
+LL ~ let c = || { let _ = &f1;
+LL +
+LL +
+LL +
+LL +
+LL +
...
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f1` to be fully captured
|
-LL | let c = || { let _ = &f1;
-LL |
-LL |
-LL |
-LL |
-LL | let _f_0 = f1.0;
+LL ~ let c = || { let _ = &f1;
+LL +
+LL +
+LL +
+LL +
+LL + let _f_0 = f1.0;
...
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr1`, `fptr2` to be fully captured
|
-LL | thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
-LL |
-LL |
-LL |
-LL |
-LL |
+LL ~ thread::spawn(move || { let _ = (&fptr1, &fptr2); unsafe {
+LL +
+LL +
+LL +
+LL +
+LL +
...
error: aborting due to 5 previous errors
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `u` to be fully captured
|
-LL | let c = || { let _ = &u;
-LL |
-LL |
-LL |
-LL | let _x = u.0.0;
-LL |
+LL ~ let c = || { let _ = &u;
+LL +
+LL +
+LL +
+LL + let _x = u.0.0;
+LL +
...
error: aborting due to 2 previous errors
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
|
-LL | let c = || { let _ = (&t, &t1, &t2);
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = (&t, &t1, &t2);
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1` to be fully captured
|
-LL | let c = || { let _ = (&t, &t1);
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = (&t, &t1);
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.0;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
-LL | let c = || { let _ = &t;
-LL |
-LL |
-LL |
-LL | let _t = t.1;
-LL |
+LL ~ let c = || { let _ = &t;
+LL +
+LL +
+LL +
+LL + let _t = t.1;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t1`, `t` to be fully captured
|
-LL | let c = move || { let _ = (&t1, &t);
-LL |
-LL |
-LL |
-LL | println!("{:?} {:?}", t1.1, t.1);
-LL |
+LL ~ let c = move || { let _ = (&t1, &t);
+LL +
+LL +
+LL +
+LL + println!("{:?} {:?}", t1.1, t.1);
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `tuple` to be fully captured
|
-LL | let c = || { let _ = &tuple;
-LL |
-LL |
-LL |
-LL | tuple.0;
-LL |
+LL ~ let c = || { let _ = &tuple;
+LL +
+LL +
+LL +
+LL + tuple.0;
+LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `tuple` to be fully captured
|
-LL | let c = || { let _ = &tuple;
-LL |
-LL |
-LL |
-LL | tuple.0;
-LL |
+LL ~ let c = || { let _ = &tuple;
+LL +
+LL +
+LL +
+LL + tuple.0;
+LL +
...
error: aborting due to 9 previous errors
help: consider further restricting this bound
|
LL | fn foo<F>(blk: F) -> X<F> where F: FnOnce() + 'static + std::marker::Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | bar(move || {
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
help: consider further restricting this bound
|
LL | fn give_owned<F>(f: F) where F: FnOnce() + Send + std::marker::Sync {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider further restricting the associated type
|
LL | fn main() where <u32 as T<'_>>::V: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | (&|&_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V);
- | ^
+ | +
error: aborting due to 2 previous errors
help: consider restricting type parameter `T`
|
LL | fn foo<T: Copy>(t: T) {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: use parentheses to call this closure
|
LL | let c1: () = c();
- | ^^
+ | ++
error: aborting due to previous error
help: use parentheses to call this closure
|
LL | let c1 : () = c();
- | ^^
+ | ++
error: aborting due to previous error
help: use parentheses to call this closure
|
LL | let c1 : () = c();
- | ^^
+ | ++
error: aborting due to previous error
help: change the output type to match the trait
|
LL | fn bar(self) -> Option<()> {}
- | ^^^^^^^^^^^^^
+ | +++++++++++++
error: aborting due to 3 previous errors
help: the delimiters should be `(` and `)`
|
LL | #[cfg_attr(all(),,)]
- | ^ ^
+ | ~ ~
error: expected identifier, found `,`
--> $DIR/cfg-attr-parse.rs:44:18
help: the delimiters should be `(` and `)`
|
LL | #[cfg_attr(all(),,)]
- | ^ ^
+ | ~ ~
error: expected identifier, found `,`
--> $DIR/cfg-attr-parse.rs:50:18
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o.closure)();
- | ^ ^
+ | + +
error: aborting due to previous error
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o_closure.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
--> $DIR/issue-2392.rs:38:15
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (o_func.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
--> $DIR/issue-2392.rs:45:14
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
LL | (boxed_fn.boxed_closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `boxed_closure` found for struct `BoxedObj` in the current scope
--> $DIR/issue-2392.rs:48:19
help: to call the function stored in `boxed_closure`, surround the field access with parentheses
|
LL | (boxed_closure.boxed_closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `closure` found for struct `Obj` in the current scope
--> $DIR/issue-2392.rs:53:12
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (w.wrap.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `not_closure` found for struct `Obj` in the current scope
--> $DIR/issue-2392.rs:55:12
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (check_expression().closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `f1` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:64:31
help: to call the function stored in `f1`, surround the field access with parentheses
|
LL | ((*self.container).f1)(1);
- | ^ ^
+ | + +
error[E0599]: no method named `f2` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:65:31
help: to call the function stored in `f2`, surround the field access with parentheses
|
LL | ((*self.container).f2)(1);
- | ^ ^
+ | + +
error[E0599]: no method named `f3` found for struct `FuncContainer` in the current scope
--> $DIR/issue-2392.rs:66:31
help: to call the function stored in `f3`, surround the field access with parentheses
|
LL | ((*self.container).f3)(1);
- | ^ ^
+ | + +
error: aborting due to 11 previous errors
help: to call the function stored in `example`, surround the field access with parentheses
|
LL | (demo.example)(1);
- | ^ ^
+ | + +
error: aborting due to previous error
help: to call the function stored in `closure`, surround the field access with parentheses
|
LL | (p.closure)();
- | ^ ^
+ | + +
error[E0599]: no method named `fn_ptr` found for reference `&&Obj<[closure@$DIR/issue-33784.rs:25:43: 25:48]>` in the current scope
--> $DIR/issue-33784.rs:29:7
help: to call the function stored in `fn_ptr`, surround the field access with parentheses
|
LL | (q.fn_ptr)();
- | ^ ^
+ | + +
error[E0599]: no method named `c_fn_ptr` found for reference `&D` in the current scope
--> $DIR/issue-33784.rs:32:7
help: to call the function stored in `c_fn_ptr`, surround the field access with parentheses
|
LL | (s.c_fn_ptr)();
- | ^ ^
+ | + +
error: aborting due to 3 previous errors
help: enclose the `const` expression in braces
|
LL | S::<{ 5 + 2 } >> 7>;
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:10:16
help: split the comparison into two
|
LL | S::<5 + 2 >> 7 && 7>;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:16:20
help: split the comparison into two
|
LL | S::<{ 5 + 2 } >> 7 && 7>;
- | ^^^^
+ | ++++
error: expected expression, found `;`
--> $DIR/closing-args-token.rs:21:16
help: split the comparison into two
|
LL | T::<x >>= 2 && 2 > 0>;
- | ^^^^
+ | ++++
error: aborting due to 5 previous errors
help: enclose the `const` expression in braces
|
LL | S::<{ 5 + 2 } >> 7>;
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:10:16
help: split the comparison into two
|
LL | S::<5 + 2 >> 7 && 7>;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/closing-args-token.rs:16:20
help: split the comparison into two
|
LL | S::<{ 5 + 2 } >> 7 && 7>;
- | ^^^^
+ | ++++
error: expected expression, found `;`
--> $DIR/closing-args-token.rs:21:16
help: split the comparison into two
|
LL | T::<x >>= 2 && 2 > 0>;
- | ^^^^
+ | ++++
error: aborting due to 5 previous errors
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | pub const fn is_zst<T>() -> usize {
- | --
+LL - pub const fn is_zst<T: ?Sized>() -> usize {
+LL + pub const fn is_zst<T>() -> usize {
+ |
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/const-argument-if-length.rs:16:12
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | pub struct AtLeastByte<T> {
- | --
+LL - pub struct AtLeastByte<T: ?Sized> {
+LL + pub struct AtLeastByte<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | pub struct AtLeastByte<T> {
- | --
+LL - pub struct AtLeastByte<T: ?Sized> {
+LL + pub struct AtLeastByte<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
help: enclose the `const` expression in braces
|
LL | i32_identity::<{ 1 + 2 }>();
- | ^ ^
+ | + +
error: aborting due to previous error
help: enclose the `const` expression in braces
|
LL | i32_identity::<{ 1 + 2 }>();
- | ^ ^
+ | + +
error: aborting due to previous error
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | fn test<const N: usize>() -> Foo<{ N }> {
- | ^ ^
+ | + +
error: aborting due to previous error
help: a struct with a similar name exists
|
LL | impl Foo for A<A> {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<N> Foo for A<N> {}
- | ^^^
+ | +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/diagnostics.rs:16:32
help: a struct with a similar name exists
|
LL | impl<const N: u8> Foo for C<N, A> {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<const N: u8, T> Foo for C<N, T> {}
- | ^^^
+ | +++
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/diagnostics.rs:7:16
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl Foo for A<{ N }> {}
- | ^ ^
+ | + +
error[E0747]: type provided when a constant was expected
--> $DIR/diagnostics.rs:12:19
help: consider changing this type parameter to be a `const` generic
|
LL | impl<const N: u8> Foo for B<N> {}
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/diagnostics.rs:16:32
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl<const N: u8> Foo for C<N, { T }> {}
- | ^ ^
+ | + +
error: aborting due to 5 previous errors
--- /dev/null
+// check-pass
+enum Foo<const N: usize> {
+ Variant,
+ Variant2(),
+ Variant3{},
+}
+
+struct Bar<const N: usize>;
+struct Bar2<const N: usize>();
+struct Bar3<const N: usize> {}
+
+fn main() {
+ let _ = Foo::Variant::<1>;
+ let _ = Foo::Variant2::<1>();
+ let _ = Foo::Variant3::<1>{};
+
+ let _ = Foo::<1>::Variant;
+ let _ = Foo::<1>::Variant2();
+ let _ = Foo::<1>::Variant3{};
+
+ let _ = Bar::<1>;
+ let _ = Bar2::<1>();
+ let _ = Bar3::<1>{};
+}
help: add missing generic argument
|
LL | foo::<0, Y>();
- | ^^^
+ | +++
error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/incorrect-number-of-const-args.rs:14:5
help: add missing generic argument
|
LL | foo::<0, Y>();
- | ^^^
+ | +++
error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/incorrect-number-of-const-args.rs:14:5
help: consider specifying the const argument
|
LL | foo::<X>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | foo::<X>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | println!("{:?}", take_array_from_mut::<N>(&mut arr, i));
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | Foo.bar().bar().bar().bar().baz::<N>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | Foo.bar().bar().bar().bar().baz::<N>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | let _: [u8; 17] = foo::<M>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | let _: [u8; 17] = foo::<M>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | Foo.foo::<A>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider specifying the const argument
|
LL | Foo.foo::<A>();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | let _: Example<{ CompileFlag::A }, _> = Example { x: 0 };
- | ^ ^
+ | + +
error[E0747]: type provided when a constant was expected
--> $DIR/invalid-enum.rs:33:18
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | let _: Example<{ Example::ASSOC_FLAG }, _> = Example { x: 0 };
- | ^ ^
+ | + +
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/invalid-enum.rs:21:12
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | test_1::<{ CompileFlag::A }>();
- | ^ ^
+ | + +
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/invalid-enum.rs:25:15
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | test_2::<_, { CompileFlag::A }>(0);
- | ^ ^
+ | + +
error: aborting due to 7 previous errors
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error; 1 warning emitted
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error; 1 warning emitted
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
+++ /dev/null
-warning: the feature `const_generics` is incomplete and may not be safe to use and/or cause compiler crashes
- --> $DIR/issue-61336.rs:1:12
- |
-LL | #![feature(const_generics)]
- | ^^^^^^^^^^^^^^
- |
- = note: `#[warn(incomplete_features)]` on by default
- = note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
-
-error[E0277]: the trait bound `T: Copy` is not satisfied
- --> $DIR/issue-61336.rs:9:5
- |
-LL | [x; N]
- | ^^^^^^ the trait `Copy` is not implemented for `T`
- |
- = note: the `Copy` trait is required because the repeated element will be copied
-help: consider restricting type parameter `T`
- |
-LL | fn g<T: Copy, const N: usize>(x: T) -> [T; N] {
- | ^^^^^^
-
-error: aborting due to previous error; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0277`.
help: add missing generic argument
|
LL | test::<2, P>();
- | ^^^
+ | +++
error: aborting due to previous error
help: enclose the `const` expression in braces
|
LL | let _: baz!({ m::P });
- | ^ ^
+ | + +
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/macro_rules-braces.rs:68:17
help: enclose the `const` expression in braces
|
LL | let _: baz!({ 10 + 7 });
- | ^ ^
+ | + +
error: constant expression depends on a generic parameter
--> $DIR/macro_rules-braces.rs:15:13
help: enclose the `const` expression in braces
|
LL | let _: baz!({ m::P });
- | ^ ^
+ | + +
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/macro_rules-braces.rs:68:17
help: enclose the `const` expression in braces
|
LL | let _: baz!({ 10 + 7 });
- | ^ ^
+ | + +
error: generic parameters may not be used in const operations
--> $DIR/macro_rules-braces.rs:36:20
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR + 3>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:9:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR + BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:12:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<3 + 3>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:15:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - 3>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:18:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:21:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<100 - BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar<i32>()>();
- | ^^
+ | ++
error: expected one of `;` or `}`, found `>`
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:24:19
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar::<i32>()>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:31:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar::<i32>() + BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:34:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<bar::<i32>() - BAR>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:37:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - bar::<i32>()>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/const-expression-suggest-missing-braces-without-turbofish.rs:40:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | foo::<BAR - bar::<i32>()>();
- | ^^
+ | ++
error: aborting due to 13 previous errors
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR + 3 }>();
- | ^ ^
+ | + +
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/const-expression-suggest-missing-braces.rs:19:11
help: enclose the `const` expression in braces
|
LL | foo::<{ 3 + 3 }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:22:15
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - 3 }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:25:15
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - BAR }>();
- | ^ ^
+ | + +
error: expressions must be enclosed in braces to be used as const generic arguments
--> $DIR/const-expression-suggest-missing-braces.rs:28:11
help: enclose the `const` expression in braces
|
LL | foo::<{ 100 - BAR }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:31:19
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar<i32>() }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:34:21
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar::<i32>() }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:37:21
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar::<i32>() + BAR }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `(`
--> $DIR/const-expression-suggest-missing-braces.rs:40:21
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ bar::<i32>() - BAR }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:43:15
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - bar::<i32>() }>();
- | ^ ^
+ | + +
error: expected one of `,` or `>`, found `-`
--> $DIR/const-expression-suggest-missing-braces.rs:46:15
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | foo::<{ BAR - bar::<i32>() }>();
- | ^ ^
+ | + +
error[E0404]: expected trait, found constant `BAR`
--> $DIR/const-expression-suggest-missing-braces.rs:11:11
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0747]: type provided when a constant was expected
--> $DIR/const-expression-suggest-missing-braces.rs:11:11
help: change the type of the numeric literal from `u16` to `u8`
|
LL | assert_eq!(R.method::<1u8>(), 1);
- | ^^^
+ | ~~~
error: aborting due to previous error
help: change the type of the numeric literal from `u16` to `u8`
|
LL | assert_eq!(R.method::<1u8>(), 1);
- | ^^^
+ | ~~~
error: aborting due to previous error
help: add missing lifetime argument
|
LL | S::<'static, 'b>(&0, &0);
- | ^^^^
+ | ++++
error[E0107]: this struct takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:19:5
help: add missing lifetime argument
|
LL | E::V::<'static, 'b>(&0);
- | ^^^^
+ | ++++
error[E0107]: this enum takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:24:8
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | A = { if let 0 = 0 { /* */ } 0 },
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | let x: [i32; { if let 0 = 0 { /* */ } 0 }] = [];
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | const X: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:8:23
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | static Y: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:13:26
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | const X: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0005]: refutable pattern in local binding: `i32::MIN..=-1_i32` and `1_i32..=i32::MAX` not covered
--> $DIR/const-match-check.rs:19:26
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | const X: i32 = { if let 0 = 0 { /* */ } 0 };
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
help: the following are the possible correct uses
|
LL | #[deprecated]
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
LL | #[deprecated(/*opt*/ since = "version", /*opt*/ note = "reason")]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | #[deprecated = "reason"]
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider dereferencing the borrow
|
LL | foo3(*u);
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:30:9
|
help: consider removing the borrow
|
-LL | foo("aaa".to_owned());
- | --
+LL - foo(&"aaa".to_owned());
+LL + foo("aaa".to_owned());
+ |
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:32:9
|
help: consider removing the borrow
|
-LL | foo("aaa".to_owned());
- | --
+LL - foo(&mut "aaa".to_owned());
+LL + foo("aaa".to_owned());
+ |
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:2:20
help: consider dereferencing the borrow
|
LL | let r = R { i: *i };
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:46:20
help: consider dereferencing the borrow
|
LL | let r = R { i: *i };
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:55:9
help: consider dereferencing the borrow
|
LL | *b
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/deref-suggestion.rs:63:9
help: consider dereferencing the borrow
|
LL | *b
- | ^
+ | +
error[E0308]: `if` and `else` have incompatible types
--> $DIR/deref-suggestion.rs:68:12
help: include the missing field in the pattern
|
LL | Struct { a, b } = Struct { a: 1, b: 2 };
- | ^^^^^
+ | ~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Struct { a, .. } = Struct { a: 1, b: 2 };
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 5 previous errors
help: use `_` to explicitly ignore each field
|
LL | TupleStruct(_, _) = TupleStruct(1, 2);
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | TupleStruct(..) = TupleStruct(1, 2);
- | ^^
+ | ~~
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
--> $DIR/tuple_struct_destructure_fail.rs:34:5
help: use `_` to explicitly ignore each field
|
LL | Enum::SingleVariant(_, _) = Enum::SingleVariant(1, 2);
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | Enum::SingleVariant(..) = Enum::SingleVariant(1, 2);
- | ^^
+ | ~~
error[E0070]: invalid left-hand side of assignment
--> $DIR/tuple_struct_destructure_fail.rs:40:12
help: use type parameters instead
|
LL | fn foo<X: K<T, T>, T>(x: X) {}
- | ^ ^ ^^^
+ | ~ ~ +++
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/bad-assoc-ty.rs:52:34
help: use type parameters instead
|
LL | fn bar<F, T>(_: F) where F: Fn() -> T {}
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/bad-assoc-ty.rs:55:19
help: use type parameters instead
|
LL | fn baz<F: Fn() -> T, T>(_: F) {}
- | ^^^^
+ | ~+++
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
--> $DIR/bad-assoc-ty.rs:58:33
help: use type parameters instead
|
LL | struct L<F, T>(F) where F: Fn() -> T;
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
--> $DIR/bad-assoc-ty.rs:60:30
help: use type parameters instead
|
LL | struct M<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for enums
--> $DIR/bad-assoc-ty.rs:64:28
help: use type parameters instead
|
LL | enum N<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for unions
--> $DIR/bad-assoc-ty.rs:69:29
help: use type parameters instead
|
LL | union O<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for traits
--> $DIR/bad-assoc-ty.rs:74:29
help: use type parameters instead
|
LL | trait P<F, T> where F: Fn() -> T {
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/bad-assoc-ty.rs:79:38
help: use type parameters instead
|
LL | fn foo<F, T>(_: F) where F: Fn() -> T {}
- | ^^^ ^
+ | +++ ~
error: aborting due to 28 previous errors
help: add `fn` here to parse `hello_method` as a public method
|
LL | pub fn hello_method(&self) {
- | ^^
+ | ++
error[E0599]: no method named `hello_method` found for struct `S` in the current scope
--> $DIR/issue-40006.rs:38:7
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | (0..13).collect::<Vec<i32>>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/issue-40396.rs:5:8
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | Vec::<i32>::new();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/issue-40396.rs:8:20
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | (0..13).collect::<Vec<i32>();
- | ^^
+ | ++
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
--> $DIR/issue-40396.rs:11:43
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | let x = std::collections::HashMap::<i128, i128>::new();
- | ^^
+ | ++
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `,`
--> $DIR/issue-40396.rs:15:39
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | std::collections::HashMap::<i128, i128>::new()
- | ^^
+ | ++
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `,`
--> $DIR/issue-40396.rs:20:39
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | std::collections::HashMap::<i128, i128>::new();
- | ^^
+ | ++
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `,`
--> $DIR/issue-40396.rs:25:39
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | std::collections::HashMap::<i128, i128>::new(1, 2);
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/issue-40396.rs:13:17
help: try using a variant of the expected enum
|
LL | this_function_expects_a_double_option(DoubleOption::FirstSome(n));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | this_function_expects_a_double_option(DoubleOption::AlternativeSome(n));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-42764.rs:27:33
help: try adding parentheses to match on a tuple...
|
LL | while let (b1, b2, b3) = reading_frame.next().expect("there should be a start codon") {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | while let b1 | b2 | b3 = reading_frame.next().expect("there should be a start codon") {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:49:14
help: try adding parentheses to match on a tuple...
|
LL | if let (b1, b2, b3) = reading_frame.next().unwrap() {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | if let b1 | b2 | b3 = reading_frame.next().unwrap() {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:59:28
help: try adding parentheses to match on a tuple...
|
LL | (Nucleotide::Adenine, Nucleotide::Cytosine, _) => true
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | Nucleotide::Adenine | Nucleotide::Cytosine | _ => true
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:67:10
help: try adding parentheses to match on a tuple...
|
LL | for (x, _barr_body) in women.iter().map(|woman| woman.allosomes.clone()) {
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | for x | _barr_body in women.iter().map(|woman| woman.allosomes.clone()) {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:75:10
help: try adding parentheses to match on a tuple...
|
LL | for (x, y @ Allosome::Y(_)) in men.iter().map(|man| man.allosomes.clone()) {
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | for x | y @ Allosome::Y(_) in men.iter().map(|man| man.allosomes.clone()) {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: unexpected `,` in pattern
--> $DIR/issue-48492-tuple-destructure-missing-parens.rs:84:14
help: try adding parentheses to match on a tuple...
|
LL | let (women, men): (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: ...or a vertical bar to match on multiple alternatives
|
LL | let women | men: (Vec<Genome>, Vec<Genome>) = genomes.iter().cloned()
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to 6 previous errors
help: Unicode character '−' (Minus Sign) looks like '-' (Minus/Hyphen), but it is not
|
LL | const UNIVERSAL_GRAVITATIONAL_CONSTANT: f64 = 6.674e-11; // m³⋅kg⁻¹⋅s⁻²
- | ^
+ | ~
error[E0277]: cannot subtract `{integer}` from `{float}`
--> $DIR/issue-49746-unicode-confusable-in-float-literal-expt.rs:1:53
help: there is an enum variant `AffixHeart::Set` and 7 others; try using the variant's enum
|
LL | fn setup() -> AffixHeart { Set }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
LL | fn setup() -> CauseToBe { Set }
- | ^^^^^^^^^
+ | ~~~~~~~~~
LL | fn setup() -> Determine { Set }
- | ^^^^^^^^^
+ | ~~~~~~~~~
LL | fn setup() -> PutDown { Set }
- | ^^^^^^^
+ | ~~~~~~~
and 3 other candidates
error[E0425]: cannot find value `Set` in this scope
help: change the type of the numeric literal from `u8` to `i8`
|
LL | OhNo = 0_i8,
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:28:16
help: change the type of the numeric literal from `i8` to `u8`
|
LL | OhNo = 0_u8,
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:41:16
help: change the type of the numeric literal from `u16` to `i16`
|
LL | OhNo = 0_i16,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:54:16
help: change the type of the numeric literal from `i16` to `u16`
|
LL | OhNo = 0_u16,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:67:16
help: change the type of the numeric literal from `u32` to `i32`
|
LL | OhNo = 0_i32,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:80:16
help: change the type of the numeric literal from `i32` to `u32`
|
LL | OhNo = 0_u32,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:93:16
help: change the type of the numeric literal from `u64` to `i64`
|
LL | OhNo = 0_i64,
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/discrim-ill-typed.rs:106:16
help: change the type of the numeric literal from `i64` to `u64`
|
LL | OhNo = 0_u64,
- | ^^^^^
+ | ~~~~~
error: aborting due to 8 previous errors
help: try adding a return type
|
LL | fn g() -> &_ {
- | ^^^^^
+ | +++++
help: consider removing the borrow
|
-LL | panic!()
- | --
+LL - &panic!()
+LL + panic!()
+ |
error[E0308]: mismatched types
--> $DIR/diverging-tuple-parts-39485.rs:12:5
= note: required for the cast to the object type `dyn Foo`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn test1<T: Foo>(t: &T) {
- | --
+LL - fn test1<T: ?Sized + Foo>(t: &T) {
+LL + fn test1<T: Foo>(t: &T) {
+ |
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/dst-object-from-unsized-type.rs:13:23
= note: required for the cast to the object type `dyn Foo`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn test2<T: Foo>(t: &T) {
- | --
+LL - fn test2<T: ?Sized + Foo>(t: &T) {
+LL + fn test2<T: Foo>(t: &T) {
+ |
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/dst-object-from-unsized-type.rs:18:28
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Foo<T: ?Sized> : Sized { fn take(self, x: &T) { } } // Note: T is sized
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `[usize]` cannot be known at compilation time
--> $DIR/dst-sized-trait-param.rs:10:6
help: you can use `as` to change the binding name of the import
|
LL | pub use std::panic as other_panic;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
LL | #[deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:4:35
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/dyn-2018-edition-lint.rs:9:14
| ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to 3 previous errors
help: add `dyn` keyword before this trait
|
LL | let _x: &dyn SomeTrait = todo!();
- | ^^^
+ | +++
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/dyn-2021-edition-error.rs:3:17
help: add `dyn` keyword before this trait
|
LL | fn function(x: &dyn SomeTrait, y: Box<SomeTrait>) {
- | ^^^
+ | +++
error[E0782]: trait objects must include the `dyn` keyword
--> $DIR/dyn-2021-edition-error.rs:3:35
help: add `dyn` keyword before this trait
|
LL | fn function(x: &SomeTrait, y: Box<dyn SomeTrait>) {
- | ^^^
+ | +++
error: aborting due to 3 previous errors
help: you can escape reserved keywords to use them as identifiers
|
LL | () => (pub fn r#async() {})
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2015-parsing.rs:26:13
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();
- | ^^^^^^^
+ | ~~~~~~~
error: no rules expected the token `r#async`
--> $DIR/edition-keywords-2018-2015-parsing.rs:20:31
help: you can escape reserved keywords to use them as identifiers
|
LL | () => (pub fn r#async() {})
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut r#async = 1;
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `async`
--> $DIR/edition-keywords-2018-2018-parsing.rs:26:13
help: you can escape reserved keywords to use them as identifiers
|
LL | module::r#async();
- | ^^^^^^^
+ | ~~~~~~~
error: no rules expected the token `r#async`
--> $DIR/edition-keywords-2018-2018-parsing.rs:20:31
help: use struct literal syntax instead
|
LL | let e1 = Empty1 {};
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let e1 = XEmpty2;
- | ^^^^^^^
+ | ~~~~~~~
error[E0423]: expected function, tuple struct or tuple variant, found struct `Empty1`
--> $DIR/empty-struct-braces-expr.rs:16:14
help: use struct literal syntax instead
|
LL | let e1 = Empty1 {};
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let e1 = XEmpty2();
- | ^^^^^^^
+ | ~~~~~~~
error[E0423]: expected value, found struct variant `E::Empty3`
--> $DIR/empty-struct-braces-expr.rs:18:14
help: use struct literal syntax instead
|
LL | let xe1 = XEmpty1 {};
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let xe1 = XEmpty2;
- | ^^^^^^^
+ | ~~~~~~~
error[E0423]: expected function, tuple struct or tuple variant, found struct `XEmpty1`
--> $DIR/empty-struct-braces-expr.rs:23:15
help: use struct literal syntax instead
|
LL | let xe1 = XEmpty1 {};
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a unit struct with a similar name exists
|
LL | let xe1 = XEmpty2();
- | ^^^^^^^
+ | ~~~~~~~
error[E0599]: no variant or associated item named `Empty3` found for enum `empty_struct::XE` in the current scope
--> $DIR/empty-struct-braces-expr.rs:25:19
help: use struct pattern syntax instead
|
LL | XE::XEmpty3 { /* fields */ } => ()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: a unit variant with a similar name exists
|
LL | XE::XEmpty4 => ()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
help: use struct pattern syntax instead
|
LL | Empty1 {} => ()
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
--> $DIR/empty-struct-braces-pat-2.rs:18:9
help: use struct pattern syntax instead
|
LL | XEmpty1 {} => ()
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct `Empty1`
--> $DIR/empty-struct-braces-pat-2.rs:21:9
help: use struct pattern syntax instead
|
LL | Empty1 {} => ()
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct `XEmpty1`
--> $DIR/empty-struct-braces-pat-2.rs:24:9
help: use struct pattern syntax instead
|
LL | XEmpty1 {} => ()
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 4 previous errors
help: use struct pattern syntax instead
|
LL | XE::XEmpty3 { /* fields */ } => ()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found struct variant `E::Empty3`
--> $DIR/empty-struct-braces-pat-3.rs:25:9
help: use struct pattern syntax instead
|
LL | XE::XEmpty3 { /* fields */ } => ()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 4 previous errors
help: use the tuple variant pattern syntax instead
|
LL | XE::XEmpty5(/* fields */) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
help: a unit variant with a similar name exists
|
LL | XE::XEmpty4 => (),
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 4 previous errors
help: `E::Empty4` is a unit variant, you need to write it without the parenthesis
|
LL | let e4 = E::Empty4;
- | ^^^^^^^^^
+ | ~~~~~~~~~
error[E0618]: expected function, found `empty_struct::XEmpty2`
--> $DIR/empty-struct-unit-expr.rs:18:15
help: `XE::XEmpty4` is a unit variant, you need to write it without the parenthesis
|
LL | let xe4 = XE::XEmpty4;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to 4 previous errors
help: use this syntax instead
|
LL | Empty2 => ()
- | ^^^^^^
+ | ~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2`
--> $DIR/empty-struct-unit-pat.rs:24:9
help: use this syntax instead
|
LL | XEmpty2 => ()
- | ^^^^^^^
+ | ~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6() => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `Empty2`
--> $DIR/empty-struct-unit-pat.rs:28:9
help: use this syntax instead
|
LL | Empty2 => ()
- | ^^^^^^
+ | ~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `XEmpty2`
--> $DIR/empty-struct-unit-pat.rs:32:9
help: use this syntax instead
|
LL | XEmpty2 => ()
- | ^^^^^^^
+ | ~~~~~~~
help: a tuple struct with a similar name exists
|
LL | XEmpty6(..) => ()
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4`
--> $DIR/empty-struct-unit-pat.rs:37:9
help: use this syntax instead
|
LL | XE::XEmpty4 => (),
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5() => (),
- | ^^^^^^^
+ | ~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found unit variant `E::Empty4`
--> $DIR/empty-struct-unit-pat.rs:46:9
help: use this syntax instead
|
LL | XE::XEmpty4 => (),
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | XE::XEmpty5(..) => (),
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 8 previous errors
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Some(y) = x { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: use `_` to explicitly ignore each field
|
LL | Fruit::Apple(a, _) => {},
- | ^^^
+ | +++
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
--> $DIR/E0023.rs:12:9
help: missing parentheses
|
LL | Fruit::Orange((a, b)) => {},
- | ^ ^
+ | + +
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 1 field
--> $DIR/E0023.rs:15:9
help: missing parentheses
|
LL | Fruit::Banana(()) => {},
- | ^ ^
+ | + +
error: aborting due to 5 previous errors
help: include the missing field in the pattern
|
LL | Dog { age: x, name } => {}
- | ^^^^^^^^
+ | ~~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Dog { age: x, .. } => {}
- | ^^^^^^
+ | ~~~~~~
error[E0027]: pattern does not mention field `age`
--> $DIR/E0027.rs:15:9
help: include the missing field in the pattern
|
LL | Dog { name: x, age } => {}
- | ^^^^^^^
+ | ~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Dog { name: x, .. } => {}
- | ^^^^^^
+ | ~~~~~~
error[E0027]: pattern does not mention field `age`
--> $DIR/E0027.rs:19:9
help: include the missing field in the pattern
|
LL | Dog { name: x, age } => {}
- | ^^^^^^^
+ | ~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | Dog { name: x, .. } => {}
- | ^^^^^^
+ | ~~~~~~
error[E0027]: pattern does not mention fields `name`, `age`
--> $DIR/E0027.rs:22:9
help: include the missing fields in the pattern
|
LL | Dog { name, age } => {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if you don't care about these missing fields, you can explicitly ignore them
|
LL | Dog { .. } => {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 4 previous errors
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0033]: type `&dyn SomeTrait` cannot be dereferenced
--> $DIR/E0033-teach.rs:12:9
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0033]: type `&dyn SomeTrait` cannot be dereferenced
--> $DIR/E0033.rs:10:9
help: disambiguate the associated function for candidate #1
|
LL | Trait1::foo()
- | ^^^^^^^^^^^
+ | ~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | Trait2::foo()
- | ^^^^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: &'a bool,
+LL ~ struct Foo<'a> {
+LL ~ x: &'a bool,
|
error[E0106]: missing lifetime specifier
|
help: consider introducing a named lifetime parameter
|
-LL | enum Bar<'a> {
+LL ~ enum Bar<'a> {
LL | A(u8),
-LL | B(&'a bool),
+LL ~ B(&'a bool),
|
error[E0106]: missing lifetime specifier
|
help: consider introducing a named lifetime parameter
|
-LL | struct Quux<'a> {
-LL | baz: Baz<'a>,
+LL ~ struct Quux<'a> {
+LL ~ baz: Baz<'a>,
|
error[E0106]: missing lifetime specifiers
|
help: consider introducing a named lifetime parameter
|
-LL | struct Quux<'a> {
+LL ~ struct Quux<'a> {
LL | baz: Baz,
LL |
LL |
-LL | buzz: Buzz<'a, 'a>,
+LL ~ buzz: Buzz<'a, 'a>,
|
error[E0106]: missing lifetime specifier
help: consider introducing a named lifetime parameter
|
LL | type MyStr<'a> = &'a str;
- | ^^^^ ^^^
+ | ++++ ~~~
error: aborting due to 5 previous errors
help: add missing lifetime argument
|
LL | buzz: Buzz<'a, 'a>,
- | ^^^^
+ | ++++
error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/E0107.rs:17:10
help: use fully qualified syntax to disambiguate
|
LL | let _: <Self as Foo>::A;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | let _: <Self as Bar>::A;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Err` in bounds of `Self`
--> $DIR/E0221.rs:21:16
help: you can use `as` to change the binding name of the import
|
LL | use bar::baz as other_baz;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use foo::alloc as other_alloc;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use bar::foo as other_foo;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f(p: &Path) { }
- | ^
+ | +
error[E0277]: the trait bound `i32: Foo` is not satisfied
--> $DIR/E0277.rs:15:15
help: surround the struct literal with parentheses
|
LL | if let S { x: _x, y: 2 } = (S { x: 1, y: 2 }) { println!("Ok"); }
- | ^ ^
+ | + +
error: expected expression, found `==`
--> $DIR/E0423.rs:14:13
help: surround the struct literal with parentheses
|
LL | for _ in (std::ops::Range { start: 0, end: 10 }) {}
- | ^ ^
+ | + +
error[E0423]: expected function, tuple struct or tuple variant, found struct `Foo`
--> $DIR/E0423.rs:4:13
help: use struct literal syntax instead
|
LL | let f = Foo { a: val };
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
help: a function with a similar name exists
|
LL | let f = foo();
- | ^^^
+ | ~~~
error[E0423]: expected value, found struct `T`
--> $DIR/E0423.rs:14:8
help: surround the struct literal with parentheses
|
LL | if (T {}) == T {} { println!("Ok"); }
- | ^ ^
+ | + +
error: aborting due to 5 previous errors
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn foo(&self) {
- | ^^^^^
+ | +++++
error[E0424]: expected value, found module `self`
--> $DIR/E0424.rs:11:9
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn baz(&self, _: i32) {
- | ^^^^^^
+ | ++++++
error[E0424]: expected value, found module `self`
--> $DIR/E0424.rs:15:20
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn qux(&self) {
- | ^^^^^
+ | +++++
error[E0424]: expected unit struct, unit variant or constant, found module `self`
--> $DIR/E0424.rs:20:9
|
help: consider importing the module directly
|
-LL | use std::fmt;
- | --
+LL - use std::fmt::self;
+LL + use std::fmt;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use std::fmt::{self};
- | ^ ^
+ | + +
error: aborting due to previous error
help: consider borrowing the value
|
LL | &*v as &u8;
- | ^^
+ | ++
error: aborting due to 2 previous errors
help: use parentheses to call the method
|
LL | f.method();
- | ^^
+ | ++
error: aborting due to previous error
help: cast the value to `unsafe extern "C" fn(*const i8, ...)`
|
LL | printf(::std::ptr::null(), printf as unsafe extern "C" fn(*const i8, ...));
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
help: `X::Entry` is a unit variant, you need to write it without the parenthesis
|
LL | X::Entry;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0618]: expected function, found `i32`
--> $DIR/E0618.rs:9:5
help: give this argument a name or use an underscore to ignore it
|
LL | fn foo(_: (i32, i32));
- | ^
+ | ~
error[E0642]: patterns aren't allowed in methods without bodies
--> $DIR/E0642.rs:11:12
help: give this argument a name or use an underscore to ignore it
|
LL | fn bar(_: (i32, i32)) {}
- | ^
+ | ~
error[E0642]: patterns aren't allowed in methods without bodies
--> $DIR/E0642.rs:13:15
help: give this argument a name or use an underscore to ignore it
|
LL | fn method(_: S) {}
- | ^
+ | ~
error: aborting due to 3 previous errors
help: use `impl Trait` as the return type, as all return paths are of type `Struct`, which implements `Trait`
|
LL | fn foo() -> impl Trait { Struct }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/E0746.rs:11:13
help: use `impl Trait` as the return type, as all return paths are of type `{integer}`, which implements `Trait`
|
LL | fn bar() -> impl Trait {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to 2 previous errors
help: consider dereferencing the borrow
|
LL | if *b_ref() {}
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:19:8
help: consider dereferencing the borrow
|
LL | if *b_mut_ref() {}
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:20:8
|
help: consider removing the borrow
|
-LL | if true {}
- | --
+LL - if &true {}
+LL + if true {}
+ |
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:21:8
|
help: consider removing the borrow
|
-LL | if true {}
- | --
+LL - if &mut true {}
+LL + if true {}
+ |
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:24:11
help: consider dereferencing the borrow
|
LL | while *b_ref() {}
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:25:11
help: consider dereferencing the borrow
|
LL | while *b_mut_ref() {}
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:26:11
|
help: consider removing the borrow
|
-LL | while true {}
- | --
+LL - while &true {}
+LL + while true {}
+ |
error[E0308]: mismatched types
--> $DIR/if-no-match-bindings.rs:27:11
|
help: consider removing the borrow
|
-LL | while true {}
- | --
+LL - while &mut true {}
+LL + while true {}
+ |
error: aborting due to 8 previous errors
help: you can use `as` to change the binding name of the import
|
LL | extern crate m2 as other_m1;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:25:5
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:28:5
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/extern-types-unsized.rs:31:5
help: consider relaxing the implicit `Sized` restriction
|
LL | fn assert_sized<T: ?Sized>() {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 4 previous errors
help: consider further restricting the associated type
|
LL | trait _Tr3 where <<Self as _Tr3>::A as Iterator>::Item: Copy {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 17 previous errors
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Ok(_x) = foo() { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider restricting type parameter `U32`
|
LL | type Pointer2<U32: std::clone::Clone> = Box<U32>;
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 8 previous errors
help: consider introducing lifetime `'a` here
|
LL | impl<'a> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'a` here
|
LL | fn my_lifetime<'a>(&self) -> &'a u8 { self.0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:55:27
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn any_lifetime<'b>() -> &'b u8 { &0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:27
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:40
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'x`
--> $DIR/feature-gate-in_band_lifetimes.rs:3:12
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> X<'b> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn inner_2<'b>(&self) -> &'b u8 {
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:23:8
help: consider introducing lifetime `'b` here
|
LL | impl<'b> X<'b> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn inner_3<'b>(&self) -> &'b u8 {
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:33:9
help: consider introducing lifetime `'a` here
|
LL | impl<'a> Y<&'a u8> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'a` here
|
LL | fn inner<'a>(&self) -> &'a u8 {
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:43:27
help: consider introducing lifetime `'b` here
|
LL | trait MyTrait<'b, 'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn any_lifetime<'b>() -> &'b u8;
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:45:27
help: consider introducing lifetime `'b` here
|
LL | trait MyTrait<'b, 'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8;
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:45:40
help: consider introducing lifetime `'b` here
|
LL | trait MyTrait<'b, 'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8;
- | ^^^^
+ | ++++
error: aborting due to 17 previous errors
help: consider turning `static_fn` into a method by giving it a `&self` argument
|
LL | fn static_fn(&self) {}
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `static_fn` so it does not apply to trait objects
|
LL | fn static_fn() where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0038]: the trait `NonObjectSafe3` cannot be made into an object
--> $DIR/feature-gate-object_safe_for_dispatch.rs:27:39
+++ /dev/null
-// Test that `#[plugin_registrar]` attribute is gated by `plugin_registrar`
-// feature gate.
-
-// the registration function isn't typechecked yet
-#[plugin_registrar]
-//~^ ERROR compiler plugins are deprecated
-//~| WARN use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated
-pub fn registrar() {}
-//~^ ERROR compiler plugins are experimental and possibly buggy
-
-fn main() {}
+++ /dev/null
-error[E0658]: compiler plugins are experimental and possibly buggy
- --> $DIR/feature-gate-plugin_registrar.rs:8:1
- |
-LL | pub fn registrar() {}
- | ^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information
- = help: add `#![feature(plugin_registrar)]` to the crate attributes to enable
-
-error[E0658]: compiler plugins are deprecated
- --> $DIR/feature-gate-plugin_registrar.rs:5:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #29597 <https://github.com/rust-lang/rust/issues/29597> for more information
- = help: add `#![feature(plugin_registrar)]` to the crate attributes to enable
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/feature-gate-plugin_registrar.rs:5:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
- |
- = note: `#[warn(deprecated)]` on by default
-
-error: aborting due to 2 previous errors; 1 warning emitted
-
-For more information about this error, try `rustc --explain E0658`.
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(x: &dyn Foo) {
- | ^
+ | +
error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
--> $DIR/feature-gate-unsized_fn_params.rs:24:5
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f(f: &dyn FnOnce()) {}
- | ^
+ | +
error: aborting due to previous error
// check-pass
-#![feature(test, plugin_registrar)]
+#![feature(test)]
#![warn(unused_attributes, unknown_lints)]
//~^ NOTE the lint level is defined here
//~| NOTE the lint level is defined here
-// Exception, a gated and deprecated attribute.
-
-#![plugin_registrar]
-//~^ WARN unused attribute
-//~| WARN use of deprecated attribute
-//~| HELP may be removed in a future compiler version
-
// UNGATED WHITE-LISTED BUILT-IN ATTRIBUTES
#![warn(x5400)] //~ WARN unknown lint: `x5400`
#![crate_id = "10"]
//~^ WARN use of deprecated attribute
//~| HELP remove this attribute
+//~| NOTE `#[warn(deprecated)]` on by default
// FIXME(#44232) we should warn that this isn't used.
#![feature(rust1)]
//~^ WARN unused attribute
}
-#[plugin_registrar]
-//~^ WARN unused attribute
-//~| WARN use of deprecated attribute
-//~| HELP may be removed in a future compiler version
-mod plugin_registrar {
- mod inner { #![plugin_registrar] }
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
- //~| NOTE `#[warn(deprecated)]` on by default
-
- // for `fn f()` case, see gated-plugin_registrar.rs
-
- #[plugin_registrar] struct S;
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
-
- #[plugin_registrar] type T = S;
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
-
- #[plugin_registrar] impl S { }
- //~^ WARN unused attribute
- //~| WARN use of deprecated attribute
- //~| HELP may be removed in a future compiler version
-}
-
// At time of unit test authorship, if compiling without `--test` then
// non-crate-level #[test] attributes seem to be ignored.
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:9
|
LL | #![warn(x5400)]
| ^^^^^
| ^^^^^^^^^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:10
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:46:10
|
LL | #![allow(x5300)]
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:54:11
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:47:11
|
LL | #![forbid(x5200)]
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:55:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:48:9
|
LL | #![deny(x5100)]
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:110:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:104:8
|
LL | #[warn(x5400)]
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:113:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:107:25
|
LL | mod inner { #![warn(x5400)] }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:110:12
|
LL | #[warn(x5400)] fn f() { }
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:113:12
|
LL | #[warn(x5400)] struct S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:122:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:116:12
|
LL | #[warn(x5400)] type T = S;
| ^^^^^
warning: unknown lint: `x5400`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:125:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:119:12
|
LL | #[warn(x5400)] impl S { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:129:9
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:123:9
|
LL | #[allow(x5300)]
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:132:26
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:126:26
|
LL | mod inner { #![allow(x5300)] }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:129:13
|
LL | #[allow(x5300)] fn f() { }
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:132:13
|
LL | #[allow(x5300)] struct S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:141:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:135:13
|
LL | #[allow(x5300)] type T = S;
| ^^^^^
warning: unknown lint: `x5300`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:144:13
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:138:13
|
LL | #[allow(x5300)] impl S { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:148:10
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:142:10
|
LL | #[forbid(x5200)]
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:151:27
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:145:27
|
LL | mod inner { #![forbid(x5200)] }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:148:14
|
LL | #[forbid(x5200)] fn f() { }
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:151:14
|
LL | #[forbid(x5200)] struct S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:160:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:154:14
|
LL | #[forbid(x5200)] type T = S;
| ^^^^^
warning: unknown lint: `x5200`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:163:14
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:157:14
|
LL | #[forbid(x5200)] impl S { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:167:8
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:161:8
|
LL | #[deny(x5100)]
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:170:25
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:164:25
|
LL | mod inner { #![deny(x5100)] }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:167:12
|
LL | #[deny(x5100)] fn f() { }
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:170:12
|
LL | #[deny(x5100)] struct S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:179:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:173:12
|
LL | #[deny(x5100)] type T = S;
| ^^^^^
warning: unknown lint: `x5100`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:182:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:176:12
|
LL | #[deny(x5100)] impl S { }
| ^^^^^
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:440:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:405:17
|
LL | mod inner { #![macro_escape] }
| ^^^^^^^^^^^^^^^^
= help: try an outer attribute: `#[macro_use]`
warning: `#[macro_escape]` is a deprecated synonym for `#[macro_use]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:437:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:402:1
|
LL | #[macro_escape]
| ^^^^^^^^^^^^^^^
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:227:17
- |
-LL | mod inner { #![plugin_registrar] }
- | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
- |
- = note: `#[warn(deprecated)]` on by default
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5
- |
-LL | #[plugin_registrar] struct S;
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
- |
-LL | #[plugin_registrar] type T = S;
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:245:5
- |
-LL | #[plugin_registrar] impl S { }
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:1
- |
-LL | #![plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
warning: use of deprecated attribute `crate_id`: no longer used.
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:90:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:83:1
|
LL | #![crate_id = "10"]
| ^^^^^^^^^^^^^^^^^^^ help: remove this attribute
+ |
+ = note: `#[warn(deprecated)]` on by default
warning: use of deprecated attribute `no_start`: no longer used.
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:99:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:93:1
|
LL | #![no_start]
| ^^^^^^^^^^^^ help: remove this attribute
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:332:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:297:1
|
LL | #[no_mangle]
| ^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:464:1
|
LL | #[cold]
| ^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:528:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:493:1
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:567:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:532:1
|
LL | #[link_section = "1800"]
| ^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:61:1
|
LL | #![cold]
| ^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:72:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:65:1
|
LL | #![link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:75:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:68:1
|
LL | #![link_section = "1800"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:337:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:302:17
|
LL | mod inner { #![no_mangle] }
| ------------^^^^^^^^^^^^^-- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:309:5
|
LL | #[no_mangle] struct S;
| ^^^^^^^^^^^^ --------- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:349:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:314:5
|
LL | #[no_mangle] type T = S;
| ^^^^^^^^^^^^ ----------- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:354:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:319:5
|
LL | #[no_mangle] impl S { }
| ^^^^^^^^^^^^ ---------- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:505:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:470:17
|
LL | mod inner { #![cold] }
| ------------^^^^^^^^-- not a function
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:512:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:5
|
LL | #[cold] struct S;
| ^^^^^^^ --------- not a function
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:517:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:482:5
|
LL | #[cold] type T = S;
| ^^^^^^^ ----------- not a function
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:522:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:487:5
|
LL | #[cold] impl S { }
| ^^^^^^^ ---------- not a function
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:534:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:5
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
help: try `#[link(name = "1900")]` instead
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:534:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:499:5
|
LL | #[link_name = "1900"]
| ^^^^^^^^^^^^^^^^^^^^^
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:541:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:506:17
|
LL | mod inner { #![link_name="1900"] }
| ------------^^^^^^^^^^^^^^^^^^^^-- not a foreign function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:546:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:511:5
|
LL | #[link_name = "1900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:551:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:516:5
|
LL | #[link_name = "1900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^ --------- not a foreign function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:556:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:521:5
|
LL | #[link_name = "1900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^ ----------- not a foreign function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a foreign function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:561:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:526:5
|
LL | #[link_name = "1900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^ ---------- not a foreign function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:573:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:538:17
|
LL | mod inner { #![link_section="1800"] }
| ------------^^^^^^^^^^^^^^^^^^^^^^^-- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:580:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:545:5
|
LL | #[link_section = "1800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^ --------- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:585:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:550:5
|
LL | #[link_section = "1800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^ ----------- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: attribute should be applied to a function or static
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:590:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:555:5
|
LL | #[link_section = "1800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^ ---------- not a function or static
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
warning: the feature `rust1` has been stable since 1.0.0 and no longer requires an attribute to enable
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:95:12
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:89:12
|
LL | #![feature(rust1)]
| ^^^^^
= note: `#[warn(stable_features)]` on by default
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:45:1
- |
-LL | #![plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:52:1
|
LL | #![should_panic]
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:60:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:53:1
|
LL | #![ignore]
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:66:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:59:1
|
LL | #![proc_macro_derive()]
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:190:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:184:5
|
LL | #[macro_use] fn f() { }
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:193:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:187:5
|
LL | #[macro_use] struct S;
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:196:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:190:5
|
LL | #[macro_use] type T = S;
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:199:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:193:5
|
LL | #[macro_use] impl S { }
| ^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:203:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:197:1
|
LL | #[macro_export]
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:206:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:200:17
|
LL | mod inner { #![macro_export] }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:209:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:203:5
|
LL | #[macro_export] fn f() { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:206:5
|
LL | #[macro_export] struct S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:215:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:209:5
|
LL | #[macro_export] type T = S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:218:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:212:5
|
LL | #[macro_export] impl S { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:222:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:227:17
- |
-LL | mod inner { #![plugin_registrar] }
- | ^^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:235:5
- |
-LL | #[plugin_registrar] struct S;
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:240:5
- |
-LL | #[plugin_registrar] type T = S;
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:245:5
- |
-LL | #[plugin_registrar] impl S { }
- | ^^^^^^^^^^^^^^^^^^^
-
-warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:300:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:265:5
|
LL | #[path = "3800"] fn f() { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:303:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:268:5
|
LL | #[path = "3800"] struct S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:306:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:271:5
|
LL | #[path = "3800"] type T = S;
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:309:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:274:5
|
LL | #[path = "3800"] impl S { }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:313:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:278:1
|
LL | #[automatically_derived]
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:316:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:281:17
|
LL | mod inner { #![automatically_derived] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:319:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:284:5
|
LL | #[automatically_derived] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:322:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:287:5
|
LL | #[automatically_derived] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:325:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:290:5
|
LL | #[automatically_derived] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:293:5
|
LL | #[automatically_derived] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:360:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:325:1
|
LL | #[should_panic]
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:363:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:328:17
|
LL | mod inner { #![should_panic] }
| ^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:331:5
|
LL | #[should_panic] fn f() { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:369:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:334:5
|
LL | #[should_panic] struct S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:337:5
|
LL | #[should_panic] type T = S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:340:5
|
LL | #[should_panic] impl S { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:379:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:344:1
|
LL | #[ignore]
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:347:17
|
LL | mod inner { #![ignore] }
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:350:5
|
LL | #[ignore] fn f() { }
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:353:5
|
LL | #[ignore] struct S;
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:356:5
|
LL | #[ignore] type T = S;
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:359:5
|
LL | #[ignore] impl S { }
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:398:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:363:1
|
LL | #[no_implicit_prelude]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:401:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:366:17
|
LL | mod inner { #![no_implicit_prelude] }
| ^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:404:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:369:5
|
LL | #[no_implicit_prelude] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:407:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:372:5
|
LL | #[no_implicit_prelude] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:410:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:375:5
|
LL | #[no_implicit_prelude] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:413:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:378:5
|
LL | #[no_implicit_prelude] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:417:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:382:1
|
LL | #[reexport_test_harness_main = "2900"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:420:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:385:17
|
LL | mod inner { #![reexport_test_harness_main="2900"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:423:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:388:5
|
LL | #[reexport_test_harness_main = "2900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:391:5
|
LL | #[reexport_test_harness_main = "2900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:429:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:394:5
|
LL | #[reexport_test_harness_main = "2900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:432:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:397:5
|
LL | #[reexport_test_harness_main = "2900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:444:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:409:5
|
LL | #[macro_escape] fn f() { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:447:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:412:5
|
LL | #[macro_escape] struct S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:450:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:415:5
|
LL | #[macro_escape] type T = S;
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:453:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:418:5
|
LL | #[macro_escape] impl S { }
| ^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:1
|
LL | #[no_std]
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:457:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:422:1
|
LL | #[no_std]
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:17
|
LL | mod inner { #![no_std] }
| ^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:461:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:426:17
|
LL | mod inner { #![no_std] }
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5
|
LL | #[no_std] fn f() { }
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:465:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:430:5
|
LL | #[no_std] fn f() { }
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:434:5
|
LL | #[no_std] struct S;
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:469:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:434:5
|
LL | #[no_std] struct S;
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5
|
LL | #[no_std] type T = S;
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:473:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:438:5
|
LL | #[no_std] type T = S;
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:442:5
|
LL | #[no_std] impl S { }
| ^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:477:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:442:5
|
LL | #[no_std] impl S { }
| ^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:623:1
|
LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:658:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:623:1
|
LL | #[crate_name = "0900"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:627:17
|
LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:662:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:627:17
|
LL | mod inner { #![crate_name="0900"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:631:5
|
LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:666:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:631:5
|
LL | #[crate_name = "0900"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:635:5
|
LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:670:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:635:5
|
LL | #[crate_name = "0900"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:639:5
|
LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:674:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:639:5
|
LL | #[crate_name = "0900"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:643:5
|
LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:678:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:643:5
|
LL | #[crate_name = "0900"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:648:1
|
LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:683:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:648:1
|
LL | #[crate_type = "0800"]
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:652:17
|
LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:687:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:652:17
|
LL | mod inner { #![crate_type="0800"] }
| ^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:656:5
|
LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:691:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:656:5
|
LL | #[crate_type = "0800"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:5
|
LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:695:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:660:5
|
LL | #[crate_type = "0800"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:664:5
|
LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:664:5
|
LL | #[crate_type = "0800"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:668:5
|
LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:668:5
|
LL | #[crate_type = "0800"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:1
|
LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:708:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:673:1
|
LL | #[feature(x0600)]
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:17
|
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:712:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:677:17
|
LL | mod inner { #![feature(x0600)] }
| ^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:681:5
|
LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:716:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:681:5
|
LL | #[feature(x0600)] fn f() { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5
|
LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:720:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:685:5
|
LL | #[feature(x0600)] struct S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:5
|
LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:724:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:689:5
|
LL | #[feature(x0600)] type T = S;
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5
|
LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:728:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:693:5
|
LL | #[feature(x0600)] impl S { }
| ^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:1
|
LL | #[no_main]
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:734:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:699:1
|
LL | #[no_main]
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:17
|
LL | mod inner { #![no_main] }
| ^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:738:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:703:17
|
LL | mod inner { #![no_main] }
| ^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
|
LL | #[no_main] fn f() { }
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:742:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:707:5
|
LL | #[no_main] fn f() { }
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
|
LL | #[no_main] struct S;
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:746:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:711:5
|
LL | #[no_main] struct S;
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:5
|
LL | #[no_main] type T = S;
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:750:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:715:5
|
LL | #[no_main] type T = S;
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:719:5
|
LL | #[no_main] impl S { }
| ^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:754:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:719:5
|
LL | #[no_main] impl S { }
| ^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:1
|
LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:772:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:737:1
|
LL | #[recursion_limit="0200"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:17
|
LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:776:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:741:17
|
LL | mod inner { #![recursion_limit="0200"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
|
LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:780:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:745:5
|
LL | #[recursion_limit="0200"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5
|
LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:784:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:749:5
|
LL | #[recursion_limit="0200"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
|
LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:788:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:753:5
|
LL | #[recursion_limit="0200"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5
|
LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:792:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:757:5
|
LL | #[recursion_limit="0200"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:1
|
LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:797:1
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:762:1
|
LL | #[type_length_limit="0100"]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:766:17
|
LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be in the root module
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:801:17
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:766:17
|
LL | mod inner { #![type_length_limit="0100"] }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5
|
LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:805:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:770:5
|
LL | #[type_length_limit="0100"] fn f() { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:774:5
|
LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:809:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:774:5
|
LL | #[type_length_limit="0100"] struct S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:778:5
|
LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:813:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:778:5
|
LL | #[type_length_limit="0100"] type T = S;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused attribute
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:782:5
|
LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: crate-level attribute should be an inner attribute: add an exclamation mark: `#![foo]`
- --> $DIR/issue-43106-gating-of-builtin-attrs.rs:817:5
+ --> $DIR/issue-43106-gating-of-builtin-attrs.rs:782:5
|
LL | #[type_length_limit="0100"] impl S { }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
-warning: 205 warnings emitted
+warning: 193 warnings emitted
help: the following are the possible correct uses
|
LL | #[macro_use] struct S;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
LL | #[macro_use(name1, name2, ...)] struct S;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
help: change the type of the numeric literal from `f64` to `f32`
|
LL | let y: f32 = 1f32;
- | ^^^^
+ | ~~~~
error: aborting due to 2 previous errors
a");
//~^ ERROR invalid format string
format!("{ \
-
+ \
b");
//~^ ERROR invalid format string
format!(r#"{ \
{ \
\
b \
-
+ \
");
//~^^^ ERROR invalid format string
format!(r#"
raw { \
-
+ \
c"#);
//~^^^ ERROR invalid format string
format!(r#"
|
LL | format!("{ \
| - because of this opening brace
-LL |
+LL | \
LL | b");
| ^ expected `}` in format string
|
help: you might be missing a string literal to format with
|
LL | format_args!("{}", || {});
- | ^^^^^
+ | +++++
error: aborting due to 2 previous errors
help: you might have forgotten to call this function
|
LL | let x = f() == g;
- | ^^^
+ | ~~~
help: you might have forgotten to call this function
|
LL | let x = f == g();
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/fn-compare-mismatch.rs:4:18
help: consider using the `'static` lifetime
|
LL | pub fn f() -> &'static u8;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider constraining the associated type `<T as X>::Y<i32>` to `Vec<i32>`
|
LL | fn f<T: X<Y<i32> = Vec<i32>>>(a: T::Y<i32>) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider introducing a named lifetime parameter
|
LL | type F<'a, T1> = &'a [u8];
- | ^^^ ^^^
+ | +++ ~~~
error: aborting due to 2 previous errors
help: add missing lifetime argument
|
LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> {
- | ^^^^^
+ | ~~~~~
error[E0107]: missing generics for associated type `X::Y`
--> $DIR/gat-trait-path-missing-lifetime.rs:10:20
help: add missing lifetime argument
|
LL | fn foo<'a, T1: X<Y<'a> = T1>>(t : T1) -> T1::Y<'a> {
- | ^^^^^
+ | ~~~~~
error: aborting due to 2 previous errors
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/gat-trait-path-parenthesised-args.rs:7:27
help: add missing lifetime argument
|
LL | fn foo<'a>(arg: Box<dyn X<Y('a, 'a) = &'a ()>>) {}
- | ^^^
+ | +++
error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/gat-trait-path-parenthesised-args.rs:7:27
help: consider restricting type parameter `T`
|
LL | type Assoc2<T: std::fmt::Display> = Vec<T>;
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0276]: impl has stricter requirements than trait
--> $DIR/generic-associated-types-where.rs:22:5
help: consider introducing lifetime `'b` here
|
LL | trait Iterable<'b> {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | type Iter<'b, 'a>: Iterator<Item = Self::Item<'a>>
- | ^^^
+ | +++
error[E0261]: use of undeclared lifetime name `'undeclared`
--> $DIR/generic_associated_type_undeclared_lifetimes.rs:11:41
help: consider introducing lifetime `'undeclared` here
|
LL | trait Iterable<'undeclared> {
- | ^^^^^^^^^^^^^
+ | +++++++++++++
help: consider introducing lifetime `'undeclared` here
|
LL | fn iter<'undeclared, 'a>(&'a self) -> Self::Iter<'undeclared>;
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 2 previous errors
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/impl_bounds.rs:22:5
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo for Fooy<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 5 previous errors
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> UnsafeCopy for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::Fn<()>> Fun for T {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error: aborting due to previous error
help: consider further restricting this bound
|
LL | impl<T: Copy + std::ops::Deref + Deref<Target = T>> UnsafeCopy<T> for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider using the `'static` lifetime
|
LL | fn create_doc() -> impl Document<Cursor<'static> = DocCursorImpl<'_>> {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: add missing lifetime argument
|
LL | inner: Box<dyn Provider<A<'a> = B>>,
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | trait Trait2: Trait1 {
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/issue-74816.rs:9:5
help: consider further restricting `Self`
|
LL | trait Trait2: Sized {
- | ^^^^^^^
+ | +++++++
error: aborting due to 2 previous errors
help: consider restricting type parameter `T`
|
LL | type Copy<T: std::clone::Clone>: Copy = Box<T>;
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 2 previous errors
help: add missing lifetime argument
|
LL | let sub: Box<dyn SuperTrait<SubType<'a> = SubStruct>> = Box::new(SuperStruct::new(0));
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0038]: the trait `SuperTrait` cannot be made into an object
--> $DIR/issue-76535.rs:36:14
help: consider relaxing the implicit `'static` requirement
|
LL | impl A for Box<dyn A + '_> {}
- | ^^^^
+ | ++++
error: incompatible lifetime on type
--> $DIR/issue-78113-lifetime-mismatch-dyn-trait-box.rs:27:5
help: consider relaxing the implicit `'static` requirement
|
LL | impl E for (Box<dyn A + '_>, Box<dyn A>) {}
- | ^^^^
+ | ++++
help: consider relaxing the implicit `'static` requirement
|
LL | impl E for (Box<dyn A>, Box<dyn A + '_>) {}
- | ^^^^
+ | ++++
error: aborting due to 3 previous errors
help: add missing generic argument
|
LL | Box::new(Family) as &dyn CollectionFamily<Member<T>=usize>
- | ^^^^^^^^^
+ | ~~~~~~~~~
error[E0038]: the trait `CollectionFamily` cannot be made into an object
--> $DIR/issue-78671.rs:7:25
help: add missing lifetime argument
|
LL | as Box<dyn MapLike<u8, u8, VRefCont<'a> = dyn RefCont<'_, u8>>>;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0038]: the trait `MapLike` cannot be made into an object
--> $DIR/issue-79422.rs:42:12
help: add missing generic argument
|
LL | MInner: Monad<Unwrapped = A, Wrapped<B> = MOuter::Wrapped<A>>,
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: add missing generic argument
|
LL | W: SomeTrait<Wrapped<A> = W>,
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: add missing lifetime argument
|
LL | fn test_simpler<'a>(dst: &'a mut impl TestMut<Output<'a> = &'a mut f32>)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: add missing generic argument
|
LL | type CType: C<DType<T> = Self>;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: add missing lifetime argument
|
LL | fn next(&mut self) -> Option<Self::Item<'_>>;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider further restricting this bound
|
LL | impl<B> Add for A<B> where B: Add + Add<Output = B> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0308]: mismatched types
--> $DIR/missing-bounds.rs:21:14
help: consider further restricting this bound
|
LL | impl<B: Add + Add<Output = B>> Add for C<B> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0369]: cannot add `B` to `B`
--> $DIR/missing-bounds.rs:31:21
help: consider restricting type parameter `B`
|
LL | impl<B: std::ops::Add<Output = B>> Add for D<B> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++
error: aborting due to 3 previous errors
help: add missing lifetime arguments
|
LL | fn foo<'c, 'd>(_arg: Box<dyn X<Y<'c, 'd> = (&'c u32, &'d u32)>>) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error[E0107]: this struct takes 3 lifetime arguments but 2 lifetime arguments were supplied
--> $DIR/missing_lifetime_args.rs:16:26
help: add missing lifetime argument
|
LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b, 'a>) {}
- | ^^^^
+ | ++++
error[E0107]: this struct takes 3 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing_lifetime_args.rs:19:16
help: add missing lifetime arguments
|
LL | fn f<'a>(_arg: Foo<'a, 'b, 'c>) {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 3 previous errors
help: add missing lifetime argument
|
LL | let _: <T as Foo>::Assoc<'a, 3>;
- | ^^^
+ | +++
error: aborting due to previous error
help: add missing generic argument
|
LL | type FErr1 = Self::E<'static, 'static, T>;
- | ^^^
+ | +++
error[E0107]: this associated type takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/parameter_number_and_kind.rs:15:27
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | fn f1<'a>(arg : Box<{ dyn X< : 32 } >>) {}
- | ^ ^
+ | + +
error: expected parameter name, found `>`
--> $DIR/trait-path-missing-gen_arg.rs:8:36
help: add missing lifetime argument
|
LL | fn f2<'a>(arg : Box<dyn X<Y<'a, 1> = &'a ()>>) {}
- | ^^^
+ | +++
error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/trait-path-type-error-once-implemented.rs:8:29
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
- --> $DIR/projection-bound-cycle-generic.rs:44:5
+ --> $DIR/projection-bound-cycle-generic.rs:44:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| - required by this bound in `OnlySized`
...
LL | type Assoc = OnlySized<<T as Foo>::Item>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0275]: overflow evaluating the requirement `<T as Foo>::Item: Sized`
- --> $DIR/projection-bound-cycle.rs:46:5
+ --> $DIR/projection-bound-cycle.rs:46:18
|
LL | struct OnlySized<T> where T: Sized { f: T }
| - required by this bound in `OnlySized`
...
LL | type Assoc = OnlySized<<T as Foo>::Item>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | pub fn life4<'b>(x: for<'c, 'a> fn(&'a i32));
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/generic-extern-lifetime.rs:11:39
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | pub fn life7<'b>() -> for<'c, 'a> fn(&'a i32);
- | ^^^^
+ | ++++
error: aborting due to 3 previous errors
help: add missing generic argument
|
LL | Foo::<isize, B>::new();
- | ^^^
+ | +++
error: aborting due to previous error
help: add missing generic argument
|
LL | let _: Vec<T>;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: consider using the `'b` lifetime
|
LL | fn bar<'b, L: X<'b, &'b Nested<i32>>>(){}
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/issue-65285-incorrect-explicit-lifetime-name-needed.rs:9:21
help: consider using one of the available lifetimes here
|
LL | fn foo<'b, L: X<'lifetime, &'b Nested<K>>>();
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to 3 previous errors
help: add missing generic arguments
|
LL | type A = Ty<A, B>;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this struct takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:30:14
help: add missing generic argument
|
LL | type B = Ty<usize, B>;
- | ^^^
+ | +++
error[E0107]: this struct takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:36:14
help: add missing generic arguments
|
LL | type E = Ty<A, B>;
- | ^^^^
+ | ++++
error[E0107]: missing generics for struct `lifetime_and_type::Ty`
--> $DIR/wrong-number-of-args.rs:48:14
help: add missing generic argument
|
LL | type A = Ty<T>;
- | ^^^^^
+ | ~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:48:14
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Ty<'a>;
- | ^^^^ ^^^^^^
+ | ++++ ~~~~~~
error[E0107]: this struct takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:54:14
help: add missing generic argument
|
LL | type B = Ty<'static, T>;
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:58:17
help: consider introducing a named lifetime parameter
|
LL | type C<'a> = Ty<'a, usize>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this struct takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:64:14
help: add missing generic argument
|
LL | type E = Ty<T>;
- | ^
+ | +
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:64:16
help: consider introducing a named lifetime parameter
|
LL | type E<'a> = Ty<'a>;
- | ^^^^ ^^
+ | ++++ ++
error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:70:14
help: add missing generic arguments
|
LL | type A = Ty<A, B>;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this struct takes at least 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:84:14
help: add missing generic argument
|
LL | type B = Ty<usize, B>;
- | ^^^
+ | +++
error[E0107]: this struct takes at most 3 generic arguments but 4 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:92:14
help: add missing generic arguments
|
LL | type F = Ty<A, B>;
- | ^^^^
+ | ++++
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:116:22
help: consider introducing a named lifetime parameter
|
LL | type B<'a> = Box<dyn GenericLifetime<'a>>;
- | ^^^^ ^^^^^^^^^^^^^^^^^^^
+ | ++++ ~~~~~~~~~~~~~~~~~~~
error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:124:22
help: add missing generic argument
|
LL | type D = Box<dyn GenericType<A>>;
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:132:22
help: consider introducing a named lifetime parameter
|
LL | type F<'a> = Box<dyn GenericLifetime<'a>>;
- | ^^^^ ^^
+ | ++++ ++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:140:22
help: add missing generic argument
|
LL | type G = Box<dyn GenericType<A>>;
- | ^
+ | +
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:151:26
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeAT<'a, AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:165:26
help: consider introducing a named lifetime parameter
|
LL | type C<'a> = Box<dyn GenericLifetimeAT<'a, (), AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:169:26
help: add missing generic argument
|
LL | type A = Box<dyn GenericTypeAT<A, AssocTy=()>>;
- | ^^
+ | ++
error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:185:26
help: add missing generic argument
|
LL | type C = Box<dyn GenericTypeAT<'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:201:48
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeTypeAT<'a, AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:201:26
help: add missing generic argument
|
LL | type A = Box<dyn GenericLifetimeTypeAT<A, AssocTy=()>>;
- | ^^
+ | ++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:207:26
help: add missing generic argument
|
LL | type B = Box<dyn GenericLifetimeTypeAT<'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:211:26
help: add missing generic argument
|
LL | type C = Box<dyn GenericLifetimeTypeAT<'static, 'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:217:48
help: consider introducing a named lifetime parameter
|
LL | type D<'a> = Box<dyn GenericLifetimeTypeAT<'a, (), AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0106]: missing lifetime specifier
--> $DIR/wrong-number-of-args.rs:221:48
help: consider introducing a named lifetime parameter
|
LL | type E<'a> = Box<dyn GenericLifetimeTypeAT<'a, (), (), AssocTy=()>>;
- | ^^^^ ^^^
+ | ++++ +++
error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:221:26
help: add missing generic arguments
|
LL | type A = Box<dyn GenericTypeTypeAT<A, B, AssocTy=()>>;
- | ^^^^^
+ | +++++
error[E0107]: this trait takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:251:26
help: add missing generic argument
|
LL | type B = Box<dyn GenericTypeTypeAT<(), B, AssocTy=()>>;
- | ^^^
+ | +++
error[E0107]: this trait takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:255:26
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeLifetimeAT<'a, 'a, AssocTy=()>>;
- | ^^^^ ^^^^^^^
+ | ++++ +++++++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:269:26
help: add missing lifetime argument
|
LL | type B = Box<dyn GenericLifetimeLifetimeAT<'static, 'b, AssocTy=()>>;
- | ^^^^
+ | ++++
error[E0106]: missing lifetime specifiers
--> $DIR/wrong-number-of-args.rs:279:56
help: consider introducing a named lifetime parameter
|
LL | type A<'a> = Box<dyn GenericLifetimeLifetimeTypeAT<'a, 'a, AssocTy=()>>;
- | ^^^^ ^^^^^^^
+ | ++++ +++++++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:279:26
help: add missing generic argument
|
LL | type A = Box<dyn GenericLifetimeLifetimeTypeAT<A, AssocTy=()>>;
- | ^^
+ | ++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:285:26
help: add missing lifetime argument
|
LL | type B = Box<dyn GenericLifetimeLifetimeTypeAT<'static, 'b, AssocTy=()>>;
- | ^^^^
+ | ++++
error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:285:26
help: add missing generic argument
|
LL | type B = Box<dyn GenericLifetimeLifetimeTypeAT<'static, A, AssocTy=()>>;
- | ^^^
+ | +++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:291:26
help: add missing lifetime argument
|
LL | type C = Box<dyn GenericLifetimeLifetimeTypeAT<'static, 'b, (), AssocTy=()>>;
- | ^^^^
+ | ++++
error[E0107]: missing generics for struct `HashMap`
--> $DIR/wrong-number-of-args.rs:301:18
help: add missing generic arguments
|
LL | type A = HashMap<K, V>;
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0107]: this struct takes at least 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:305:18
help: add missing generic argument
|
LL | type B = HashMap<String, V>;
- | ^^^
+ | +++
error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:309:18
help: add missing generic arguments
|
LL | type C = HashMap<'static, K, V>;
- | ^^^^^^
+ | ++++++
error[E0107]: this struct takes at most 3 generic arguments but 4 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:315:18
help: add missing generic arguments
|
LL | type E = HashMap<K, V>;
- | ^^^^
+ | ++++
error[E0107]: missing generics for enum `Result`
--> $DIR/wrong-number-of-args.rs:325:18
help: add missing generic arguments
|
LL | type A = Result<T, E>;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:329:18
help: add missing generic argument
|
LL | type B = Result<String, E>;
- | ^^^
+ | +++
error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:333:18
help: add missing generic arguments
|
LL | type C = Result<'static, T, E>;
- | ^^^^^^
+ | ++++++
error[E0107]: this enum takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:339:18
help: add missing generic arguments
|
LL | type E = Result<T, E>;
- | ^^^^
+ | ++++
error: aborting due to 71 previous errors
help: consider further restricting this bound
|
LL | where B : Qux + for<'ccx> Bar<'ccx>
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error
help: consider further restricting this bound
|
LL | where F : Foo<'x> + for<'tcx> Foo<'tcx>
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
--> $DIR/hrtb-higher-ranker-supertraits.rs:35:26
help: consider further restricting this bound
|
LL | where B : Bar<'x> + for<'ccx> Bar<'ccx>
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to 2 previous errors
help: you might be missing a string literal to format with
|
LL | format_args!("{}", { #[derive(Clone)] struct S; });
- | ^^^^^
+ | +++++
error: aborting due to previous error
help: use `!` to invoke the macro
|
LL | semitransparent!;
- | ^
+ | +
error[E0423]: expected value, found macro `opaque`
--> $DIR/rustc-macro-transparency.rs:30:5
help: use `!` to invoke the macro
|
LL | opaque!;
- | ^
+ | +
error: aborting due to 3 previous errors
help: consider introducing a named lifetime parameter
|
LL | type Output<'a> = &'a i32;
- | ^^^^ ^^^
+ | ++++ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/assoc-type.rs:16:20
help: consider introducing a named lifetime parameter
|
LL | type Output<'a> = &'a i32;
- | ^^^^ ^^
+ | ++++ ~~
error: aborting due to 2 previous errors
help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc` to `()`
|
LL | fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error[E0760]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
--> $DIR/bound-normalization-fail.rs:41:41
help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
|
LL | fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 3 previous errors
help: to force the closure to take ownership of `prefix` (and any other referenced variables), use the `move` keyword
|
LL | self.data.iter().filter(move |s| s.starts_with(prefix)).map(|s| s.as_ref())
- | ^^^^
+ | ++++
error: aborting due to previous error
help: use `impl Trait` as the return type, as all return paths are of type `Struct`, which implements `Trait`
|
LL | fn bap() -> impl Trait { Struct }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:15:13
help: use `impl Trait` as the return type, as all return paths are of type `Struct`, which implements `Trait`
|
LL | fn ban() -> impl Trait { Struct }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:17:13
help: use some type `T` that is `T: Sized` as the return type if all return paths have the same type
|
LL | fn bak() -> T { unimplemented!() }
- | ^
+ | ~
help: use `impl Trait` as the return type if all return paths have the same type but you want to expose only the trait in the signature
|
LL | fn bak() -> impl Trait { unimplemented!() }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: use a boxed trait object if all return paths implement trait `Trait`
|
LL | fn bak() -> Box<dyn Trait> { unimplemented!() }
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:19:13
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn bal() -> Box<dyn Trait> {
+LL ~ fn bal() -> Box<dyn Trait> {
LL | if true {
-LL | return Box::new(Struct);
+LL ~ return Box::new(Struct);
LL | }
-LL | Box::new(42)
+LL ~ Box::new(42)
|
error[E0308]: `if` and `else` have incompatible types
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn bax() -> Box<dyn Trait> {
+LL ~ fn bax() -> Box<dyn Trait> {
LL | if true {
-LL | Box::new(Struct)
+LL ~ Box::new(Struct)
LL | } else {
-LL | Box::new(42)
+LL ~ Box::new(42)
|
error[E0308]: mismatched types
help: store this in the heap by calling `Box::new`
|
LL | return Box::new(Struct);
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:36:5
help: store this in the heap by calling `Box::new`
|
LL | Box::new(42)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:40:16
help: store this in the heap by calling `Box::new`
|
LL | return Box::new(0);
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:42:5
help: store this in the heap by calling `Box::new`
|
LL | Box::new(42)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:46:9
help: store this in the heap by calling `Box::new`
|
LL | Box::new(Struct)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:48:9
help: store this in the heap by calling `Box::new`
|
LL | Box::new(42)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:53:9
help: store this in the heap by calling `Box::new`
|
LL | Box::new(0)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:55:9
help: store this in the heap by calling `Box::new`
|
LL | Box::new(42)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:60:13
help: use `impl Trait` as the return type, as all return paths are of type `{integer}`, which implements `Trait`
|
LL | fn bat() -> impl Trait {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0746]: return type cannot have an unboxed trait object
--> $DIR/dyn-trait-return-should-be-impl-trait.rs:66:13
help: use `impl Trait` as the return type, as all return paths are of type `{integer}`, which implements `Trait`
|
LL | fn bay() -> impl Trait {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to 20 previous errors
help: consider constraining the associated type `<impl Foo as Leak>::T` to `i32`
|
LL | fn hide<T: Foo>(x: T) -> impl Foo<T = i32> {
- | ^^^^^^^^^
+ | +++++++++
error[E0308]: mismatched types
--> $DIR/equality2.rs:38:10
help: add missing generic argument
|
LL | f::<[u8], U>("a", b"a");
- | ^^^
+ | +++
error: aborting due to previous error
|
help: try removing the generic parameter and using `impl Trait` instead
|
-LL | fn foo(&self, _: &impl Debug) { }
- | -- ^^^^^^^^^^
+LL - fn foo<U: Debug>(&self, _: &U) { }
+LL + fn foo(&self, _: &impl Debug) { }
+ |
error[E0643]: method `bar` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:17:23
help: try changing the `impl Trait` argument to a generic parameter
|
LL | fn bar<U: Debug>(&self, _: &U) { }
- | ^^^^^^^^^^ ^
+ | ++++++++++ ~
error[E0643]: method `hash` has incompatible signature for trait
--> $DIR/impl-generic-mismatch.rs:28:33
--- /dev/null
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/issue-55872-1.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error[E0276]: impl has stricter requirements than trait
+ --> $DIR/issue-55872-1.rs:17:5
+ |
+LL | fn foo<T>() -> Self::E;
+ | ----------------------- definition of `foo` from trait
+...
+LL | fn foo<T: Default>() -> Self::E {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default`
+
+error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
+ --> $DIR/issue-55872-1.rs:13:14
+ |
+LL | type E = impl Copy;
+ | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S`
+ |
+ = note: required because it appears within the type `(S, T)`
+help: consider further restricting this bound
+ |
+LL | impl<S: Default + std::marker::Copy> Bar for S {
+ | +++++++++++++++++++
+
+error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
+ --> $DIR/issue-55872-1.rs:13:14
+ |
+LL | type E = impl Copy;
+ | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T`
+ |
+ = note: required because it appears within the type `(S, T)`
+help: consider further restricting this bound
+ |
+LL | fn foo<T: Default + std::marker::Copy>() -> Self::E {
+ | +++++++++++++++++++
+
+error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ --> $DIR/issue-55872-1.rs:17:37
+ |
+LL | fn foo<T: Default>() -> Self::E {
+ | _____________________________________^
+LL | |
+LL | |
+LL | | (S::default(), T::default())
+LL | | }
+ | |_____^
+
+error: aborting due to 4 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0276, E0277.
+For more information about an error, try `rustc --explain E0276`.
impl<S: Default> Bar for S {
type E = impl Copy;
- //~^ ERROR the trait bound `S: Copy` is not satisfied in `(S, T)` [E0277]
- //~^^ ERROR the trait bound `T: Copy` is not satisfied in `(S, T)` [E0277]
fn foo<T: Default>() -> Self::E {
//~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
//~| ERROR impl has stricter requirements than trait
+ //~| ERROR the trait bound `S: Copy` is not satisfied in `(S, T)` [E0277]
+ //~| ERROR the trait bound `T: Copy` is not satisfied in `(S, T)` [E0277]
(S::default(), T::default())
}
}
error[E0276]: impl has stricter requirements than trait
- --> $DIR/issue-55872-1.rs:14:5
+ --> $DIR/issue-55872-1.rs:12:5
|
LL | fn foo<T>() -> Self::E;
| ----------------------- definition of `foo` from trait
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `T: Default`
error[E0277]: the trait bound `S: Copy` is not satisfied in `(S, T)`
- --> $DIR/issue-55872-1.rs:10:14
+ --> $DIR/issue-55872-1.rs:12:29
|
-LL | type E = impl Copy;
- | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S`
+LL | fn foo<T: Default>() -> Self::E {
+ | ^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `S`
|
= note: required because it appears within the type `(S, T)`
help: consider further restricting this bound
|
LL | impl<S: Default + std::marker::Copy> Bar for S {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied in `(S, T)`
- --> $DIR/issue-55872-1.rs:10:14
+ --> $DIR/issue-55872-1.rs:12:29
|
-LL | type E = impl Copy;
- | ^^^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T`
+LL | fn foo<T: Default>() -> Self::E {
+ | ^^^^^^^ within `(S, T)`, the trait `Copy` is not implemented for `T`
|
= note: required because it appears within the type `(S, T)`
help: consider further restricting this bound
|
LL | fn foo<T: Default + std::marker::Copy>() -> Self::E {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872-1.rs:14:37
+ --> $DIR/issue-55872-1.rs:12:37
|
LL | fn foo<T: Default>() -> Self::E {
| _____________________________________^
LL | |
LL | |
+LL | |
+LL | |
LL | | (S::default(), T::default())
LL | | }
| |_____^
impl<S> Bar for S {
type E = impl std::marker::Copy;
- //~^ ERROR the trait bound `impl Future: Copy` is not satisfied [E0277]
fn foo<T>() -> Self::E {
//~^ ERROR type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
+ //~| ERROR the trait bound `impl Future: Copy` is not satisfied [E0277]
async {}
}
}
error[E0277]: the trait bound `impl Future: Copy` is not satisfied
- --> $DIR/issue-55872-2.rs:13:14
+ --> $DIR/issue-55872-2.rs:14:20
|
-LL | type E = impl std::marker::Copy;
- | ^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `impl Future`
+LL | fn foo<T>() -> Self::E {
+ | ^^^^^^^ the trait `Copy` is not implemented for `impl Future`
error: type parameter `T` is part of concrete type but not used in parameter list for the `impl Trait` type alias
- --> $DIR/issue-55872-2.rs:15:28
+ --> $DIR/issue-55872-2.rs:14:28
|
LL | fn foo<T>() -> Self::E {
| ____________________________^
LL | |
+LL | |
LL | | async {}
LL | | }
| |_____^
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/must_outlive_least_region_or_bound.rs:5:32
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/must_outlive_least_region_or_bound.rs:7:46
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided(x: &i32) -> impl Copy + '_ { x }
- | ^^^^
+ | ++++
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:5:44
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit<'a>(x: &'a i32) -> impl Copy + 'a { x }
- | ^^^^
+ | ++++
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:7:46
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided2(x: &i32) -> impl Copy + '_ { x }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided2(x: &'static i32) -> impl Copy + 'static { x }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:9:55
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit2<'a>(x: &'a i32) -> impl Copy + 'a { x }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit2<'a>(x: &'static i32) -> impl Copy + 'static { x }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0621]: explicit lifetime required in the type of `x`
--> $DIR/must_outlive_least_region_or_bound.rs:11:24
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
- | ^^^^
+ | ++++
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:22:69
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug + '_>, impl Debug) { (Box::new(x), x) }
- | ^^^^
+ | ++++
help: to declare that the `impl Trait` captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided5(x: &i32) -> (Box<dyn Debug>, impl Debug + '_) { (Box::new(x), x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:28:69
help: consider changing the `impl Trait`'s explicit `'static` bound to the lifetime of argument `x`
|
LL | fn with_bound<'a>(x: &'a i32) -> impl LifetimeTrait<'a> + 'a { x }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn with_bound<'a>(x: &'static i32) -> impl LifetimeTrait<'a> + 'static { x }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0623]: lifetime mismatch
--> $DIR/must_outlive_least_region_or_bound.rs:32:61
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'_` lifetime bound
|
LL | fn elided3(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:16:59
help: to declare that the trait object captures data from argument `x`, you can add an explicit `'a` lifetime bound
|
LL | fn explicit3<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
- | ^^^^
+ | ++++
error[E0759]: `x` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:18:60
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn elided4(x: &i32) -> Box<dyn Debug + '_> { Box::new(x) }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn elided4(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0759]: `x` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/must_outlive_least_region_or_bound.rs:20:69
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn explicit4<'a>(x: &'a i32) -> Box<dyn Debug + 'a> { Box::new(x) }
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn explicit4<'a>(x: &'static i32) -> Box<dyn Debug + 'static> { Box::new(x) }
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to 14 previous errors
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) -> Self;
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() -> Self where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0038]: the trait `NotObjectSafe` cannot be made into an object
--> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:28:13
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) -> Self;
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() -> Self where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
help: you could change the return type to be a boxed trait object
|
LL | fn cat() -> Box<dyn ObjectSafe> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(A);
+LL ~ return Box::new(A);
LL | }
-LL | Box::new(B)
+LL ~ Box::new(B)
|
error: aborting due to 2 previous errors
help: you could change the return type to be a boxed trait object
|
LL | fn foo() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | }
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: mismatched types
help: you could change the return type to be a boxed trait object
|
LL | fn bar() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | } else {
-LL | return Box::new(1u32);
+LL ~ return Box::new(1u32);
|
error[E0308]: mismatched types
help: you could change the return type to be a boxed trait object
|
LL | fn baz() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: `if` and `else` have incompatible types
help: you could change the return type to be a boxed trait object
|
LL | fn qux() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | Box::new(0i32)
+LL ~ Box::new(0i32)
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: mismatched types
help: you could change the return type to be a boxed trait object
|
LL | fn bat() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | 0 => return Box::new(0i32),
-LL | _ => Box::new(1u32),
+LL ~ 0 => return Box::new(0i32),
+LL ~ _ => Box::new(1u32),
|
error[E0308]: mismatched types
help: you could change the return type to be a boxed trait object
|
LL | fn can() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | Box::new(match 13 {
-LL | 0 => return Box::new(0i32),
+LL ~ Box::new(match 13 {
+LL ~ 0 => return Box::new(0i32),
LL | 1 => 1u32,
LL | _ => 2u32,
-LL | })
+LL ~ })
|
error[E0308]: mismatched types
help: you could change the return type to be a boxed trait object
|
LL | fn cat() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | }
LL | _ => {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0308]: `match` arms have incompatible types
help: you could change the return type to be a boxed trait object
|
LL | fn dog() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | 0 => Box::new(0i32),
-LL | 1 => Box::new(1u32),
+LL ~ 0 => Box::new(0i32),
+LL ~ 1 => Box::new(1u32),
|
error[E0308]: `if` and `else` have incompatible types
help: you could change the return type to be a boxed trait object
|
LL | fn apt() -> Box<dyn std::fmt::Display> {
- | ^^^^^^^ ^
+ | ~~~~~~~ +
help: if you change the return type to expect trait objects, box the returned expressions
|
-LL | Box::new(0i32)
+LL ~ Box::new(0i32)
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error[E0746]: return type cannot have an unboxed trait object
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn hat() -> Box<dyn std::fmt::Display> {
+LL ~ fn hat() -> Box<dyn std::fmt::Display> {
LL | match 13 {
LL | 0 => {
-LL | return Box::new(0i32);
+LL ~ return Box::new(0i32);
LL | }
LL | _ => {
...
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn pug() -> Box<dyn std::fmt::Display> {
+LL ~ fn pug() -> Box<dyn std::fmt::Display> {
LL | match 13 {
-LL | 0 => Box::new(0i32),
-LL | 1 => Box::new(1u32),
-LL | _ => Box::new(2u32),
+LL ~ 0 => Box::new(0i32),
+LL ~ 1 => Box::new(1u32),
+LL ~ _ => Box::new(2u32),
|
error[E0308]: `if` and `else` have incompatible types
= note: you can create a new `enum` with a variant for each returned type
help: return a boxed trait object instead
|
-LL | fn man() -> Box<dyn std::fmt::Display> {
+LL ~ fn man() -> Box<dyn std::fmt::Display> {
LL | if false {
-LL | Box::new(0i32)
+LL ~ Box::new(0i32)
LL | } else {
-LL | Box::new(1u32)
+LL ~ Box::new(1u32)
|
error: aborting due to 14 previous errors
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/static-return-lifetime-infered.rs:9:37
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter_values_anon(&self) -> impl Iterator<Item=u32> + '_ {
- | ^^^^
+ | ++++
error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/static-return-lifetime-infered.rs:10:16
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter_values<'a>(&'a self) -> impl Iterator<Item=u32> + 'a {
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
help: use parentheses to call the method
|
LL | let _f = 10i32.abs();
- | ^^
+ | ++
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use sub2::foo as other_foo;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you might have meant to use the following enum variant
|
LL | B::B1;
- | ^^^^^
+ | ~~~~~
error[E0425]: cannot find value `C` in this scope
--> $DIR/glob-resolve1.rs:29:5
help: an enum with a similar name exists
|
LL | foo::<B>();
- | ^
+ | ~
help: consider importing this enum
|
LL | use bar::A;
help: an enum with a similar name exists
|
LL | foo::<B>();
- | ^
+ | ~
help: consider importing this struct
|
LL | use bar::C;
help: an enum with a similar name exists
|
LL | foo::<B>();
- | ^
+ | ~
help: consider importing this type alias
|
LL | use bar::D;
help: you can use `as` to change the binding name of the import
|
LL | use self::A as OtherA;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0255]: the name `B` is defined multiple times
--> $DIR/issue-19498.rs:5:1
help: you can use `as` to change the binding name of the import
|
LL | use self::B as OtherB;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0255]: the name `D` is defined multiple times
--> $DIR/issue-19498.rs:9:5
help: you can use `as` to change the binding name of the import
|
LL | use C::D as OtherD;
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Add as OtherAdd;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Sub` is defined multiple times
--> $DIR/issue-24081.rs:9:1
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Sub as OtherSub;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Mul` is defined multiple times
--> $DIR/issue-24081.rs:11:1
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Mul as OtherMul;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Div` is defined multiple times
--> $DIR/issue-24081.rs:13:1
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Div as OtherDiv;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Rem` is defined multiple times
--> $DIR/issue-24081.rs:15:1
help: you can use `as` to change the binding name of the import
|
LL | use std::ops::Rem as OtherRem;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
help: you can use `as` to change the binding name of the import
|
LL | use bar::baz as other_baz;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0252]: the name `Quux` is defined multiple times
--> $DIR/issue-25396.rs:7:5
help: you can use `as` to change the binding name of the import
|
LL | use bar::Quux as OtherQuux;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error[E0252]: the name `blah` is defined multiple times
--> $DIR/issue-25396.rs:10:5
help: you can use `as` to change the binding name of the import
|
LL | use bar::blah as other_blah;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0252]: the name `WOMP` is defined multiple times
--> $DIR/issue-25396.rs:13:5
help: you can use `as` to change the binding name of the import
|
LL | use bar::WOMP as OtherWOMP;
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
help: you can use `as` to change the binding name of the import
|
LL | use extension2::ConstructorExtension as OtherConstructorExtension;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
|
help: consider importing the module directly
|
-LL | use foo;
- | --
+LL - use foo::self;
+LL + use foo;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::{self};
- | ^ ^
+ | + +
error[E0255]: the name `foo` is defined multiple times
--> $DIR/import-self.rs:6:11
help: you can use `as` to change the binding name of the import
|
LL | use foo::{self as other_foo};
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0255]: the name `foo` is defined multiple times
--> $DIR/import-self.rs:12:5
help: you can use `as` to change the binding name of the import
|
LL | use foo as other_foo;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0252]: the name `A` is defined multiple times
--> $DIR/import-self.rs:16:11
help: you can use `as` to change the binding name of the import
|
LL | use foo::{self as OtherA};
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
help: you can use `as` to change the binding name of the import
|
LL | use foo::{A, B as OtherA};
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use std as other_issue_45829_b;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use foo::{A, bar::B as OtherA};
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use std::{collections::HashMap as A, sync::Arc as OtherA};
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use std as other_core;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use issue_52891::b::inner as other_inner;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0254]: the name `issue_52891` is defined multiple times
--> $DIR/issue-52891.rs:31:19
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{baz}};
- | ^^^^^^^^^ --^^
+LL - use issue_59764::foo::{baz, makro};
+LL + use issue_59764::{makro, foo::{baz}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:21:9
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
-LL | }};
+LL ~
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
-LL | }};
+LL ~
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{baz, foobar}};
- | ^^^^^^^^^ -- ^^
+LL - use issue_59764::foo::{baz, makro, foobar};
+LL + use issue_59764::{makro, foo::{baz, foobar}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:40:9
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
+LL ~
LL | foobar,
-LL | }};
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foo::{
+LL ~ use issue_59764::{makro, foo::{
LL | baz,
-LL |
+LL ~
LL | foobar
-LL | }};
+LL ~ }};
|
error[E0432]: unresolved import `issue_59764::foo::makro`
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foobaz};
- | ^^^^^^^ --
+LL - use issue_59764::{foobaz, foo::makro};
+LL + use issue_59764::{makro, foobaz};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:59:42
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foobaz, foo::{baz}};
- | ^^^^^^^ --
+LL - use issue_59764::{foobaz, foo::{baz, makro}};
+LL + use issue_59764::{makro, foobaz, foo::{baz}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:68:13
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro,
+LL ~ use issue_59764::{makro,
LL | foobaz,
LL | foo::{
LL | baz,
-LL |
+LL ~
|
error[E0432]: unresolved import `issue_59764::foo::makro`
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro,
+LL ~ use issue_59764::{makro,
LL | foobaz,
LL | foo::{
LL | baz,
-LL |
+LL ~
|
error[E0432]: unresolved import `issue_59764::foo::makro`
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro, foobaz, foo::{baz, barbaz::{barfoo}}};
- | ^^^^^^^ --
+LL - use issue_59764::{foobaz, foo::{baz, makro, barbaz::{barfoo}}};
+LL + use issue_59764::{makro, foobaz, foo::{baz, barbaz::{barfoo}}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:93:13
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro,
+LL ~ use issue_59764::{makro,
LL | foobaz,
LL | foo::{
LL | baz,
-LL |
+LL ~
|
error[E0432]: unresolved import `issue_59764::foo::makro`
help: a macro with this name exists at the root of the crate
|
LL | use issue_59764::makro as baz;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:107:33
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | use issue_59764::{makro as foobar, foo::{baz}};
- | ^^^^^^^^^^^^^^^^^^^ --^^
+LL - use issue_59764::foo::{baz, makro as foobar};
+LL + use issue_59764::{makro as foobar, foo::{baz}};
+ |
error[E0432]: unresolved import `issue_59764::foo::makro`
--> $DIR/issue-59764.rs:120:17
= note: this could be because a macro annotated with `#[macro_export]` will be exported at the root of the crate instead of the module where it is defined
help: a macro with this name exists at the root of the crate
|
-LL | issue_59764::{makro as foobar,
+LL ~ issue_59764::{makro as foobar,
LL |
LL | foobaz,
LL |
LL |
-LL | foo::{baz}
+LL ~ foo::{baz}
|
error[E0432]: unresolved import `issue_59764::foo::makro`
help: a macro with this name exists at the root of the crate
|
LL | use issue_59764::makro;
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: cannot determine resolution for the macro `makro`
--> $DIR/issue-59764.rs:130:1
help: you can use `as` to change the binding name of the import
|
LL | use baz::bar as other_bar;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider introducing a named lifetime parameter
|
LL | struct Heartbreak<'a>(Betrayal<'a>);
- | ^^^^ ^^^^^^^^^^^^
+ | ++++ ~~~~~~~~~~~~
error: aborting due to previous error
help: consider introducing lifetime `'test` here
|
LL | fn bar<'test>() {
- | ^^^^^^^
+ | +++++++
help: consider making the type lifetime-generic with a new `'test` lifetime
|
LL | let y: for<'test> fn(&'test u32) = foo2;
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to 2 previous errors
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | bar::<isize>(i.try_into().unwrap()); // i should not be re-coerced back to an isize
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
help: give this closure an explicit return type without `_` placeholders
|
LL | let x = |a: (), b: ()| -> Result<(), _> {
- | ^^^^^^^^^^^^^^^^
+ | ++++++++++++++++
error: aborting due to previous error
help: give this closure an explicit return type without `_` placeholders
|
LL | let x = || -> Result<(), QualifiedError<_>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: disambiguate the associated function for candidate #1
|
LL | assert_eq!(IpuIterator::ipu_flatten(&'x'), 0);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | assert_eq!(IpuItertools::ipu_flatten(&'x'), 0);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: try using a conversion method
|
LL | x = (box x).to_string();
- | ^ ^^^^^^^^^^^^^
+ | + +++++++++++++
error[E0055]: reached the recursion limit while auto-dereferencing `Foo`
--> $DIR/infinite-autoderef.rs:25:5
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Take` representable
|
LL | struct Take(Box<Take>);
- | ^^^^ ^
+ | ++++ +
error[E0391]: cycle detected when computing drop-check constraints for `Take`
--> $DIR/infinite-struct.rs:1:1
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `MList` representable
|
LL | enum MList { Cons(isize, Box<MList>), Nil }
- | ^^^^ ^
+ | ++++ +
error[E0391]: cycle detected when computing drop-check constraints for `MList`
--> $DIR/infinite-tag-type-recursion.rs:1:1
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(a16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:41:11
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(a32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:44:11
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:47:11
help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:51:12
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(a32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:58:12
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:61:12
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:65:12
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | id_i32(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:75:12
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
LL | id_i32(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:79:12
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
LL | id_i64(asize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:93:14
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
LL | id_isize(a32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:102:14
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
LL | id_isize(a64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:108:11
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(c16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:111:11
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(c32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:114:11
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
LL | id_i8(c64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:118:12
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(c32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:125:12
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
LL | id_i16(c64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:129:12
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | id_i32(c64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:140:12
help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(b16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:155:11
help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(b32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:158:11
help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:161:11
help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit
|
LL | id_u8(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:165:12
help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
|
LL | id_u16(b32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:172:12
help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit
|
LL | id_u16(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:175:12
help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit
|
LL | id_u16(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:179:12
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
LL | id_u32(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:189:12
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | id_u32(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:193:12
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | id_u64(bsize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:207:14
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
LL | id_usize(b32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/integer-literal-suffix-inference.rs:216:14
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
LL | id_usize(b64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 52 previous errors
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Serializable<'self, T: ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 9 previous errors
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
LL | foo((1*(1 as isize)).try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-13359.rs:10:9
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | bar((1*(1 as usize)).try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
help: consider using the `'static` lifetime
|
LL | &'static str
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: change the type of the numeric literal from `i32` to `u32`
|
LL | let x: u32 = 20u32;
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: use parentheses to call the method
|
LL | fn foo(res : Box<dyn ResponseHook>) { res.get() }
- | ^^
+ | ++
error: aborting due to previous error
help: add missing generic argument
|
LL | fn fn1(0: Box<T>) {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: change the type of the numeric literal from `i32` to `u32`
|
LL | println!("{}", foo(10u32));
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: to declare that the trait object captures data from argument `value`, you can add an explicit `'_` lifetime bound
|
LL | fn foo<T: Any>(value: &T) -> Box<dyn Any + '_> {
- | ^^^^
+ | ++++
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { foo: Box<Option<Option<Foo>>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Baz` representable
|
LL | struct Baz { q: Box<Option<Foo>> }
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `Foo` has infinite size
--> $DIR/issue-17431-2.rs:4:1
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { q: Box<Option<Baz>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { foo: Box<Mutex<Option<Foo>>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo<T> { foo: Box<Option<Option<Foo<T>>>>, marker: marker::PhantomData<T> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
|
LL | struct Bar<T> { x: Box<Bar<Foo>> , marker: marker::PhantomData<T> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | enum Foo { X(Box<Mutex<Option<Foo>>>) }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | enum Foo { Voo(Box<Option<Option<Foo>>>) }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: try using the variant's enum
|
LL | fn new() -> foo::MyEnum {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: an enum with a similar name exists
|
LL | fn new() -> Result<MyEnum, String> {
- | ^^^^^^
+ | ~~~~~~
error[E0573]: expected type, found variant `Result`
--> $DIR/issue-17546.rs:24:17
help: try using the variant's enum
|
LL | fn newer() -> foo::MyEnum {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: an enum with a similar name exists
|
LL | fn newer() -> Result<foo::MyEnum, String> {
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 4 previous errors
help: use the tuple variant pattern syntax instead
|
LL | MyOption::MySome(42) => (),
- | ^^^^
+ | ~~~~
error: aborting due to previous error
--> $DIR/issue-18446.rs:18:7
|
LL | x.foo();
- | --^^^--
- | | |
- | | multiple `foo` found
- | help: disambiguate the associated function for candidate #2: `T::foo(&x)`
+ | ^^^ multiple `foo` found
|
note: candidate #1 is defined in an impl for the type `(dyn T + 'a)`
--> $DIR/issue-18446.rs:9:5
|
LL | fn foo(&self);
| ^^^^^^^^^^^^^^
+help: disambiguate the associated function for candidate #2
+ |
+LL | T::foo(&x);
+ | ~~~~~~~~~~
error: aborting due to previous error
help: consider turning `qiz` into a method by giving it a `&self` argument
|
LL | fn qiz(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `qiz` so it does not apply to trait objects
|
LL | fn qiz() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to previous error
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | type Foo = for<'a> fn(&'a u8, &'a u8) -> &'a u8;
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ~~~~~~ ~~~~~~ ~~~
help: consider introducing a named lifetime parameter
|
LL | type Foo<'a> = fn(&'a u8, &'a u8) -> &'a u8;
- | ^^^^ ^^^^^^ ^^^^^^ ^^^
+ | ++++ ~~~~~~ ~~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/issue-19707.rs:5:27
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | fn bar<F: for<'a> Fn(&'a u8, &'a u8) -> &'a u8>(f: &F) {}
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ~~~~~~ ~~~~~~ ~~~
help: consider introducing a named lifetime parameter
|
LL | fn bar<'a, F: Fn(&'a u8, &'a u8) -> &'a u8>(f: &F) {}
- | ^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++ ~~~~~~ ~~~~~~ ~~~
error: aborting due to 2 previous errors
help: consider restricting type parameter `T`
|
LL | impl<T: Bound> Trait2 for Foo<T> {}
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
error[E0275]: overflow evaluating the requirement `<FooStruct as Foo>::A == _`
- --> $DIR/issue-21946.rs:8:5
+ --> $DIR/issue-21946.rs:8:14
|
LL | type A = <FooStruct as Foo>::A;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
help: consider borrowing the value
|
LL | &0 as &dyn std::any::Any;
- | ^
+ | +
error: aborting due to previous error
help: consider borrowing the value
|
LL | let indexer = &(&*self as &dyn Index<usize, Output = <Self as Index<usize>>::Output>);
- | ^
+ | +
error: aborting due to previous error
help: try comparing the cast value
|
LL | println!("{}", (a as usize) < long_name);
- | ^ ^
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:9:33
help: try comparing the cast value
|
LL | println!("{}{}", (a as usize) < long_name, long_name);
- | ^ ^
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:11:31
help: try comparing the cast value
|
LL | println!("{}", (a as usize) < 4);
- | ^ ^
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:13:31
help: try comparing the cast value
|
LL | println!("{}{}", (a: usize) < long_name, long_name);
- | ^ ^
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:15:29
help: try comparing the cast value
|
LL | println!("{}", (a: usize) < 4);
- | ^ ^
+ | + +
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
--> $DIR/issue-22644.rs:20:20
|
help: try comparing the cast value
|
-LL | println!("{}", (a
+LL ~ println!("{}", (a
LL | as
-LL | usize)
+LL ~ usize)
|
error: `<` is interpreted as a start of generic arguments for `usize`, not a comparison
|
help: try comparing the cast value
|
-LL | println!("{}", (a
+LL ~ println!("{}", (a
LL |
LL |
LL | as
help: try shifting the cast value
|
LL | println!("{}", (a as usize) << long_name);
- | ^ ^
+ | + +
error: expected type, found `4`
--> $DIR/issue-22644.rs:34:28
help: consider further restricting the associated type
|
LL | fn push_process<P>(process: P) where P: Process<'static>, <P as Process<'_>>::Item: Iterator {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++
error: aborting due to previous error
help: add missing generic argument
|
LL | println!("{:?}",(vfnfer[0] as dyn Fn<Args>)(3));
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0191]: the value of the associated type `Output` (from trait `FnOnce`) must be specified
--> $DIR/issue-23024.rs:9:39
error[E0275]: overflow evaluating the requirement `<GetNext<T> as Next>::Next == _`
- --> $DIR/issue-23122-1.rs:10:5
+ --> $DIR/issue-23122-1.rs:10:17
|
LL | type Next = <GetNext<T> as Next>::Next;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
error[E0275]: overflow evaluating the requirement `<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next: Sized`
- --> $DIR/issue-23122-2.rs:9:5
+ --> $DIR/issue-23122-2.rs:9:17
|
LL | type Next = <GetNext<T::Next> as Next>::Next;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`issue_23122_2`)
note: required because of the requirements on the impl of `Next` for `GetNext<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<T as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next as Next>::Next>`
help: a method `len` also exists, call it with parentheses
|
LL | let v = s.len();
- | ^^
+ | ++
error[E0616]: field `len` of struct `S` is private
--> $DIR/issue-26472.rs:12:7
help: consider introducing a named lifetime parameter
|
LL | fn parse_type<'a>(iter: Box<dyn Iterator<Item=&str>+'static>) -> &'a str { iter.next() }
- | ^^^^ ^^^
+ | ++++ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/issue-26638.rs:4:40
help: consider using the `'static` lifetime
|
LL | fn parse_type_2(iter: fn(&u8)->&u8) -> &'static str { iter() }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/issue-26638.rs:7:22
help: consider using the `'static` lifetime
|
LL | fn parse_type_3() -> &'static str { unimplemented!() }
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to 3 previous errors
help: consider further restricting `Self`
|
LL | fn foo(self) -> &'static i32 where Self: Sized {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(&self) -> &'static i32 {
- | ^
+ | +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Pong` representable
|
LL | pub struct Pong(Box<SendPacket<Ping>>);
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let _ = |x: f64| x * 2.0_f32.exp();
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
help: consider borrowing the value
|
LL | let _q: &isize = &*p as &isize;
- | ^^
+ | ++
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
|
LL | BarSome(Box<Bar>)
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Bar` representable
|
LL | struct Bar { x: Box<Bar> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `E2` representable
|
LL | enum E2<T> { V2(Box<E2<E1>>, marker::PhantomData<T>), }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: consider introducing a named lifetime parameter
|
LL | fn f<'a>(a: &'a S, b: i32) -> &'a i32 {
- | ^^^^ ^^^^^ ^^^
+ | ++++ ~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/issue-30255.rs:14:34
help: consider introducing a named lifetime parameter
|
LL | fn g<'a>(a: &'a S, b: bool, c: &'a i32) -> &'a i32 {
- | ^^^^ ^^^^^ ^^^^^^^ ^^^
+ | ++++ ~~~~~ ~~~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/issue-30255.rs:19:44
help: consider introducing a named lifetime parameter
|
LL | fn h<'a>(a: &'a bool, b: bool, c: &'a S, d: &'a i32) -> &'a i32 {
- | ^^^^ ^^^^^^^^ ^^^^^ ^^^^^^^ ^^^
+ | ++++ ~~~~~~~~ ~~~~~ ~~~~~~~ ~~~
error: aborting due to 3 previous errors
help: use the tuple variant pattern syntax instead
|
LL | Foo::Bar(_) => {}
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: a unit variant with a similar name exists
|
LL | Foo::Baz => {}
- | ^^^
+ | ~~~
error[E0532]: expected tuple struct or tuple variant, found unit struct `S`
--> $DIR/issue-32004.rs:16:9
help: consider dereferencing
|
LL | let _: *const u8 = &*a;
- | ^
+ | +
error: aborting due to previous error
help: consider dereferencing
|
LL | let _: *const u8 = &***a;
- | ^^^
+ | +++
error: aborting due to previous error
help: consider constraining the associated type `<T as Tr<'a>>::Out` to `()`
|
LL | pub fn f<'a, T: Tr<'a, Out = ()>>() -> <T as Tr<'a>>::Out {}
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Expr` representable
|
LL | Plus(Box<Expr>, Box<Expr>),
- | ^^^^ ^ ^^^^ ^
+ | ++++ + ++++ +
error: aborting due to previous error
help: consider further restricting this bound
|
LL | pub fn baz<T: Foo + Copy>(x: T) -> T {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: there is an enum variant `Baz::Foo`; try using the variant's enum
|
LL | inner: Baz
- | ^^^
+ | ~~~
error[E0412]: cannot find type `Foo` in this scope
--> $DIR/issue-35075.rs:6:9
help: there is an enum variant `Baz::Foo`; try using the variant's enum
|
LL | Foo(Baz)
- | ^^^
+ | ~~~
error: aborting due to 2 previous errors
help: use parentheses to instantiate this tuple struct
|
LL | fn test() -> Foo { Foo(_) }
- | ^^^
+ | +++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | fn func<'a, T: std::ops::Mul<Output = &T>>(a: &'a [T]) -> impl Iterator<Item=&'a T> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++
error: aborting due to previous error
help: there is an enum variant `Fruit::Apple`; try using the variant's enum
|
LL | fn should_return_fruit() -> Fruit {
- | ^^^^^
+ | ~~~~~
error[E0425]: cannot find function, tuple struct or tuple variant `Apple` in this scope
--> $DIR/issue-35675.rs:9:5
help: there is an enum variant `x::Enum::Variant3`; try using the variant's enum
|
LL | fn bar() -> x::Enum {
- | ^^^^^^^
+ | ~~~~~~~
error[E0573]: expected type, found variant `Some`
--> $DIR/issue-35675.rs:28:13
help: borrowed types always have a statically known size
|
LL | V(&[Box<E>]),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | V(Box<[Box<E>]>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: disambiguate the associated function for candidate #1
|
LL | ToPrimitive::to_int(&self) + other.to_int()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | Add::to_int(&self) + other.to_int()
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `S` representable
|
LL | element: Box<Option<S>>
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn _test(ref _p: &str) {}
- | ^
+ | +
error: aborting due to previous error
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | pub fn example(ref s: &str) {}
- | ^
+ | +
error: aborting due to previous error
help: you must specify a concrete type for this numeric value, like `i32`
|
LL | 3_i32.f()
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: consider further restricting the associated type
|
LL | fn baz(_: Self::Target) where Self: Deref, <Self as Deref>::Target: Sized {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn baz(_: &Self::Target) where Self: Deref {}
- | ^
+ | +
error[E0277]: the size for values of type `(dyn ToString + 'static)` cannot be known at compilation time
--> $DIR/issue-42312.rs:8:10
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | pub fn f(_: &dyn ToString) {}
- | ^
+ | +
error: aborting due to 2 previous errors
help: try comparing the cast value
|
LL | ($i as u32) < 0
- | ^ ^
+ | + +
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Complete for T {}
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _a = b.to_owned() + ", World!";
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
|
help: move the `..` to the end of the field list
|
-LL | let Point { y, .. } = p;
- | -- ^^^^
+LL - let Point { .., y, } = p;
+LL + let Point { y, .. } = p;
+ |
error: expected `}`, found `,`
--> $DIR/issue-49257.rs:11:19
|
help: move the `..` to the end of the field list
|
-LL | let Point { y , .. } = p;
- | -- ^^^^^^
+LL - let Point { .., y } = p;
+LL + let Point { y , .. } = p;
+ |
error: expected `}`, found `,`
--> $DIR/issue-49257.rs:12:19
help: give this argument a name or use an underscore to ignore it
|
LL | fn foo(_: [i32; 2]) {}
- | ^
+ | ~
error: aborting due to previous error
help: consider dereferencing the borrow
|
LL | let _: () = *Borrow::borrow(&owned);
- | ^
+ | +
error: aborting due to previous error
help: you might have meant to use `self` here instead
|
LL | self.a
- | ^^^^
+ | ~~~~
help: if you meant to use `self`, you are also missing a `self` receiver argument
|
LL | fn a(&self) -> A {
- | ^^^^^
+ | +++++
error[E0425]: cannot find value `this` in this scope
--> $DIR/issue-5099.rs:6:9
help: you might have meant to use `self` here instead
|
LL | self.b(x);
- | ^^^^
+ | ~~~~
help: if you meant to use `self`, you are also missing a `self` receiver argument
|
LL | fn b(&self, x: i32) {
- | ^^^^^^
+ | ++++++
error[E0425]: cannot find value `this` in this scope
--> $DIR/issue-5099.rs:9:20
help: you might have meant to use `self` here instead
|
LL | let _ = || self.a;
- | ^^^^
+ | ~~~~
help: if you meant to use `self`, you are also missing a `self` receiver argument
|
LL | fn c(&self) {
- | ^^^^^
+ | +++++
error: aborting due to 3 previous errors
found type `isize`
help: try removing this `?`
|
-LL | missing_discourses()
- | --
+LL - missing_discourses()?
+LL + missing_discourses()
+ |
help: try using a variant of the expected enum
|
LL | Ok(missing_discourses()?)
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let a = (1.0_f32).pow(1.0);
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: `+=` can be used on `isize`, you can dereference `x`
|
LL | let x = |ref x: isize| { *x += 1; };
- | ^
+ | +
error: aborting due to previous error
help: if this is intentional, prefix it with an underscore
|
LL | E::A(_x) | E::B(_x) => {}
- | ^^ ^^
+ | ~~ ~~
error: unused variable: `x`
--> $DIR/issue-56685.rs:25:14
help: if this is intentional, prefix it with an underscore
|
LL | F::A(_x, y) | F::B(_x, y) => { y },
- | ^^ ^^
+ | ~~ ~~
error: unused variable: `a`
--> $DIR/issue-56685.rs:27:14
help: if this is intentional, prefix it with an underscore
|
LL | let _ = if let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
- | ^^ ^^
+ | ~~ ~~
error: unused variable: `x`
--> $DIR/issue-56685.rs:39:20
help: if this is intentional, prefix it with an underscore
|
LL | while let F::A(_x, y) | F::B(_x, y) = F::A(1, 2) {
- | ^^ ^^
+ | ~~ ~~
error: aborting due to 6 previous errors
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ObjectType` representable
|
LL | Array(Box<TypeSignature>),
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `TypeSignature` has infinite size
--> $DIR/issue-57271.rs:19:1
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `TypeSignature` representable
|
LL | Object(Box<ObjectType>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | r: &dyn A + 'static
- | ^
+ | +
error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time
--> $DIR/issue-5883.rs:9:6
help: you might have forgotten to call this function
|
LL | foo() > foo;
- | ^^^^^
+ | ~~~~~
help: you might have forgotten to call this function
|
LL | foo > foo();
- | ^^^^^
+ | ~~~~~
error[E0369]: binary operation `>` cannot be applied to type `fn() -> i32 {foo}`
--> $DIR/issue-59488.rs:25:9
help: consider further restricting the associated type
|
LL | fn main() where <() as Trait<'_>>::Item: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++
error: aborting due to 2 previous errors
help: disambiguate the associated function for candidate #1
|
LL | async::r#struct(&r#fn {});
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | await::r#struct(&r#fn {});
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::ops::AddAssign> Foo<T> {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error
|
help: consider introducing a named lifetime parameter
|
-LL | enum F<'a> {
-LL | M (§&'a u8)}
+LL ~ enum F<'a> {
+LL ~ M (§&'a u8)}
|
error: aborting due to 2 previous errors
help: consider dereferencing
|
LL | let _: *const u8 = &***a;
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:46:22
help: consider dereferencing
|
LL | let _: *mut u8 = &mut ***a;
- | ^^^^^^^
+ | +++++++
error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:49:24
help: consider dereferencing
|
LL | let _: *const u8 = &***a;
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/issue-71676-1.rs:52:22
help: consider dereferencing
|
LL | let _: *mut u8 = &mut ***a;
- | ^^^
+ | +++
error: aborting due to 4 previous errors
help: consider dereferencing
|
LL | let _: *mut u8 = &mut ***a;
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ElemDerived` representable
|
LL | A(Box<ElemDerived>)
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: if you don't need to use the contents of _x, discard the tuple's remaining fields
|
LL | (_a, ..) => {}
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-72574-1.rs:4:19
help: if you don't need to use the contents of _x, discard the tuple's remaining fields
|
LL | Binder(_a, ..) => {}
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-72574-2.rs:6:25
help: use `_` to explicitly ignore each field
|
LL | Binder(_a, _x @ .., _) => {}
- | ^^^
+ | +++
error: aborting due to 3 previous errors
help: you might have meant to use one of the following enum variants
|
LL | (A::Struct {}).foo();
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
LL | (A::Tuple()).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`
--> $DIR/issue-73427.rs:31:5
help: the following enum variants are available
|
LL | (B::StructWithFields { /* fields */ }).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LL | (B::TupleWithFields(/* fields */)).foo();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0423]: expected value, found enum `C`
--> $DIR/issue-73427.rs:33:5
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`
--> $DIR/issue-73427.rs:35:5
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`
--> $DIR/issue-73427.rs:40:13
help: try to construct one of the enum's variants
|
LL | let x = A::TupleWithFields(3);
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
LL | let x = A::Tuple(3);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0532]: expected tuple struct or tuple variant, found enum `A`
--> $DIR/issue-73427.rs:42:12
help: try to match against one of the enum's variants
|
LL | if let A::TupleWithFields(3) = x { }
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
LL | if let A::Tuple(3) = x { }
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to 6 previous errors
help: ignore the inaccessible and unused fields
|
LL | let foo::Foo { .. } = foo::Foo::default();
- | ^^^^^^
+ | ~~~~~~
error: pattern requires `..` due to inaccessible fields
--> $DIR/issue-76077-1.rs:16:9
help: ignore the inaccessible and unused fields
|
LL | let foo::Bar { visible, .. } = foo::Bar::default();
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
help: you may want to move the range into the match block
|
LL | 0..=255 => {}
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-76191.rs:15:9
help: consider dereferencing the borrow
|
LL | while Some(*0) = value.get(0) {
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/issue-77218.rs:3:11
help: a trait with a similar name exists
|
LL | _func: Fn,
- | ^^
+ | ~~
help: you might be missing a type parameter
|
LL | struct Map2<Segment2, F> {
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/issue-78720.rs:7:39
help: consider further restricting `Self`
|
LL | fn map2<F>(self, f: F) -> Map2<F> where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn map2<F>(&self, f: F) -> Map2<F> {}
- | ^
+ | +
error: aborting due to 4 previous errors
help: consider creating a fresh reborrow of `v` here
|
LL | for n in &mut *v {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0107]: missing generics for trait `Foo`
--> $DIR/issue-86756.rs:5:15
help: add missing generic argument
|
LL | eq::<dyn, Foo<T>>
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 3 previous errors; 1 warning emitted
help: consider relaxing the implicit `Sized` restriction
|
LL | fn ref_arg<T: ?Send + ?Sized>(_: &T) {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error; 3 warnings emitted
help: change the type of the numeric literal from `i64` to `isize`
|
LL | A = 1isize,
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-8761.rs:5:9
help: change the type of the numeric literal from `u8` to `isize`
|
LL | B = 2isize
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
|
= note: `#[warn(array_into_iter)]` on by default
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | let _: Iter<'_, i32> = array.iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | let _: Iter<'_, i32> = IntoIterator::into_iter(array);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-2018.rs:18:44
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | let _: Iter<'_, i32> = Box::new(array).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | let _: Iter<'_, i32> = IntoIterator::into_iter(Box::new(array));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-2018.rs:29:24
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | for _ in [1, 2, 3].iter() {}
- | ^^^^
+ | ~~~~
help: or remove `.into_iter()` to iterate by value
|
-LL | for _ in [1, 2, 3] {}
- | --
+LL - for _ in [1, 2, 3].into_iter() {}
+LL + for _ in [1, 2, 3] {}
+ |
warning: 3 warnings emitted
|
= note: `#[warn(array_into_iter)]` on by default
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | small.iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(small);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:13:12
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | [1, 2].iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter([1, 2]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:16:9
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | big.iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(big);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:19:15
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | [0u8; 33].iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter([0u8; 33]);
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:23:21
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new(small).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new(small));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:26:22
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new([1, 2]).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new([1, 2]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:29:19
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new(big).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new(big));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:32:25
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new([0u8; 33]).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new([0u8; 33]));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:36:31
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new(Box::new(small)).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new(Box::new(small)));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:39:32
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new(Box::new([1, 2])).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new(Box::new([1, 2])));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:42:29
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new(Box::new(big)).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new(Box::new(big)));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: this method call resolves to `<&[T; N] as IntoIterator>::into_iter` (due to backwards compatibility), but will resolve to <[T; N] as IntoIterator>::into_iter in Rust 2021.
--> $DIR/into-iter-on-arrays-lint.rs:45:35
| ^^^^^^^^^
|
= warning: this changes meaning in Rust 2021
- = note: for more information, see issue #66145 <https://github.com/rust-lang/rust/issues/66145>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/IntoIterator-for-arrays.html>
help: use `.iter()` instead of `.into_iter()` to avoid ambiguity
|
LL | Box::new(Box::new([0u8; 33])).iter();
- | ^^^^
+ | ~~~~
help: or use `IntoIterator::into_iter(..)` instead of `.into_iter()` to explicitly iterate by value
|
LL | IntoIterator::into_iter(Box::new(Box::new([0u8; 33])));
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ++++++++++++++++++++++++ ~
warning: 12 warnings emitted
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#extern = 0;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | use r#extern::foo;
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0432]: unresolved import `r#extern`
--> $DIR/keyword-extern-as-identifier-use.rs:1:5
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:18:13
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:25:31
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:25:31
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `String: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:38:13
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:18:13
help: consider restricting type parameter `T`
|
LL | fn f<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be sent between threads safely
--> $DIR/kindck-impl-type-params.rs:25:31
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Send>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: the trait bound `T: Copy` is not satisfied
--> $DIR/kindck-impl-type-params.rs:25:31
help: consider restricting type parameter `T`
|
LL | fn g<T: std::marker::Copy>(val: T) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0477]: the type `&'a isize` does not fulfill the required lifetime
--> $DIR/kindck-impl-type-params.rs:32:13
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'while_loop;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/label_misspelled.rs:54:9
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'while_let;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/label_misspelled.rs:59:9
help: use `break` on its own without a value inside this `for` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'for_loop;
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: aborting due to 11 previous errors; 10 warnings emitted
help: consider using the `'static` lifetime
|
LL | fn f() -> &'static isize {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:7:33
help: consider introducing a named lifetime parameter
|
LL | fn g<'a>(_x: &'a isize, _y: &'a isize) -> &'a isize {
- | ^^^^ ^^^^^^^^^ ^^^^^^^^^ ^^^
+ | ++++ ~~~~~~~~~ ~~~~~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:17:19
help: consider introducing a named lifetime parameter
|
LL | fn h<'a>(_x: &'a Foo) -> &'a isize {
- | ^^^^ ^^^^^^^ ^^^
+ | ++++ ~~~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:21:20
help: consider using the `'static` lifetime
|
LL | fn i(_x: isize) -> &'static isize {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:34:24
help: consider using the `'static` lifetime
|
LL | fn j(_x: StaticStr) -> &'static isize {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/lifetime-elision-return-type-requires-explicit-lifetime.rs:40:49
help: consider using the `'a` lifetime
|
LL | fn k<'a, T: WithLifetime<'a>>(_x: T::Output) -> &'a isize {
- | ^^^
+ | ~~~
error: aborting due to 6 previous errors
help: consider introducing a named lifetime parameter
|
LL | fn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | ++++ ~~~~~~~ ~~~~~~~ ~~~
error: aborting due to previous error
help: consider introducing lifetime `'b` here
|
LL | impl<'b> T for Test {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'b` here
|
LL | fn foo<'b>(&'b self) {}
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/undeclared-lifetime-used-in-debug-macro-issue-70152.rs:3:9
help: to force the closure to take ownership of `a` (and any other referenced variables), use the `move` keyword
|
LL | [0].iter().flat_map(|a| [0].iter().map(move |_| &a));
- | ^^^^
+ | ++++
error: aborting due to previous error
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/bare-trait-objects-path.rs:17:5
| ^^^^^ help: use `dyn`: `<dyn (::Dyn)>`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/bare-trait-objects-path.rs:20:5
| ^^^ help: use `dyn`: `<dyn Dyn>`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 3 warnings emitted
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = 2 == 3;
- | ^^^^^^^
+ | +++++++
warning: unused comparison that must be used
--> $DIR/fn_must_use.rs:75:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = m == n;
- | ^^^^^^^
+ | +++++++
warning: 8 warnings emitted
|
= note: requested on the command line with `--force-warn bare-trait-objects`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: 1 warning emitted
|
= note: requested on the command line with `--force-warn bare-trait-objects`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: 1 warning emitted
|
= note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: 1 warning emitted
|
= note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: 1 warning emitted
|
= note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: 1 warning emitted
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: `...` range patterns are deprecated
--> $DIR/inclusive-range-pattern-syntax.rs:16:9
| ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: 2 warnings emitted
help: rename the identifier or convert it to a snake case raw identifier
|
LL | mod r#impl {}
- | ^^^^^^
+ | ~~~~~~
error: function `While` should have a snake case name
--> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:8:4
help: rename the identifier or convert it to a snake case raw identifier
|
LL | fn r#while() {}
- | ^^^^^^^
+ | ~~~~~~~
error: variable `Mod` should have a snake case name
--> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:12:9
help: rename the identifier or convert it to a snake case raw identifier
|
LL | let r#mod: usize = 0;
- | ^^^^^
+ | ~~~~~
error: variable `Super` should have a snake case name
--> $DIR/lint-non-snake-case-identifiers-suggestion-reserved.rs:16:9
help: perhaps you intended to use this type
|
LL | depth: Option<i32>,
- | ^^^
+ | ~~~
help: you might be missing a type parameter
|
LL | struct Data<int> {
- | ^^^^^
+ | +++++
error[E0412]: cannot find type `short` in this scope
--> $DIR/recommend-literal.rs:33:16
| ^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn _foo(_x: &u32) {}
- | -- --
+LL - fn _foo<'a>(_x: &'a u32) {}
+LL + fn _foo(_x: &u32) {}
+ |
error: aborting due to previous error; 1 warning emitted
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = &42;
- | ^^^^^^^
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:9:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = &mut foo(42);
- | ^^^^^^^
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:12:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = &&42;
- | ^^^^^^^
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:15:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = &&mut 42;
- | ^^^^^^^
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:18:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = &mut &42;
- | ^^^^^^^
+ | +++++++
error: unused borrow that must be used
--> $DIR/unused-borrows.rs:23:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = && foo(42);
- | ^^^^^^^
+ | +++++++
error: aborting due to 6 previous errors
help: try ignoring the field
|
LL | A { i, j: _ } | B { i, j: _ } => {
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:30:16
help: try ignoring the field
|
LL | A { i, j: _ } | B { i, j: _ } => {
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:40:21
help: try ignoring the field
|
LL | Some(A { i, j: _ } | B { i, j: _ }) => {
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error: unused variable: `j`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:52:21
help: try ignoring the field
|
LL | Some(A { i, j: _ } | B { i, j: _ }) => {
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error: unused variable: `i`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:62:24
help: try ignoring the field
|
LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => {
- | ^^^^ ^
+ | ~~~~ ~
error: unused variable: `i`
--> $DIR/issue-67691-unused-field-in-or-pattern.rs:70:24
help: try ignoring the field
|
LL | MixedEnum::A { i: _ } | MixedEnum::B(_) => {
- | ^^^^ ^
+ | ~~~~ ~
error: aborting due to 6 previous errors
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = function() && return 1;
- | ^^^^^^^
+ | +++++++
error: aborting due to previous error
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val == 1;
- | ^^^^^^^
+ | +++++++
warning: unused comparison that must be used
--> $DIR/must-use-ops.rs:13:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val < 1;
- | ^^^^^^^
+ | +++++++
warning: unused comparison that must be used
--> $DIR/must-use-ops.rs:14:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val <= 1;
- | ^^^^^^^
+ | +++++++
warning: unused comparison that must be used
--> $DIR/must-use-ops.rs:15:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val != 1;
- | ^^^^^^^
+ | +++++++
warning: unused comparison that must be used
--> $DIR/must-use-ops.rs:16:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val >= 1;
- | ^^^^^^^
+ | +++++++
warning: unused comparison that must be used
--> $DIR/must-use-ops.rs:17:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val > 1;
- | ^^^^^^^
+ | +++++++
warning: unused arithmetic operation that must be used
--> $DIR/must-use-ops.rs:20:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val + 2;
- | ^^^^^^^
+ | +++++++
warning: unused arithmetic operation that must be used
--> $DIR/must-use-ops.rs:21:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val - 2;
- | ^^^^^^^
+ | +++++++
warning: unused arithmetic operation that must be used
--> $DIR/must-use-ops.rs:22:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val / 2;
- | ^^^^^^^
+ | +++++++
warning: unused arithmetic operation that must be used
--> $DIR/must-use-ops.rs:23:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val * 2;
- | ^^^^^^^
+ | +++++++
warning: unused arithmetic operation that must be used
--> $DIR/must-use-ops.rs:24:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = val % 2;
- | ^^^^^^^
+ | +++++++
warning: unused logical operation that must be used
--> $DIR/must-use-ops.rs:27:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = true && true;
- | ^^^^^^^
+ | +++++++
warning: unused logical operation that must be used
--> $DIR/must-use-ops.rs:28:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = false || true;
- | ^^^^^^^
+ | +++++++
warning: unused bitwise operation that must be used
--> $DIR/must-use-ops.rs:31:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = 5 ^ val;
- | ^^^^^^^
+ | +++++++
warning: unused bitwise operation that must be used
--> $DIR/must-use-ops.rs:32:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = 5 & val;
- | ^^^^^^^
+ | +++++++
warning: unused bitwise operation that must be used
--> $DIR/must-use-ops.rs:33:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = 5 | val;
- | ^^^^^^^
+ | +++++++
warning: unused bitwise operation that must be used
--> $DIR/must-use-ops.rs:34:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = 5 << val;
- | ^^^^^^^
+ | +++++++
warning: unused bitwise operation that must be used
--> $DIR/must-use-ops.rs:35:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = 5 >> val;
- | ^^^^^^^
+ | +++++++
warning: unused unary operation that must be used
--> $DIR/must-use-ops.rs:38:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = !val;
- | ^^^^^^^
+ | +++++++
warning: unused unary operation that must be used
--> $DIR/must-use-ops.rs:39:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = -val;
- | ^^^^^^^
+ | +++++++
warning: unused unary operation that must be used
--> $DIR/must-use-ops.rs:40:5
help: use `let _ = ...` to ignore the resulting value
|
LL | let _ = *val_pointer;
- | ^^^^^^^
+ | +++++++
warning: 21 warnings emitted
help: you might have meant to return this value
|
LL | return true;
- | ^^^^^^ ^
+ | ++++++ +
error: aborting due to 5 previous errors
help: use `break` on its own without a value inside this `for` loop
|
LL | break
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
help: alternatively, you might have meant to use the available loop label
|
LL | break 'while_loop;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:30:13
help: use `break` on its own without a value inside this `while` loop
|
LL | break 'while_loop;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:38:12
help: use `break` on its own without a value inside this `while` loop
|
LL | if break {
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:43:9
help: use `break` on its own without a value inside this `while` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `while` loop
--> $DIR/loop-break-value.rs:49:13
help: use `break` on its own without a value inside this `while` loop
|
LL | break 'while_let_loop;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/loop-break-value.rs:56:9
help: use `break` on its own without a value inside this `for` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/loop-break-value.rs:57:9
help: use `break` on its own without a value inside this `for` loop
|
LL | break;
- | ^^^^^
+ | ~~~~~
error[E0571]: `break` with value from a `for` loop
--> $DIR/loop-break-value.rs:64:13
help: use `break` on its own without a value inside this `for` loop
|
LL | break 'for_loop;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/loop-break-value.rs:4:31
help: you might have meant to break the loop with this value
|
LL | break 1;
- | ^^^^^ ^
+ | +++++ +
error[E0308]: mismatched types
--> $DIR/loop-no-implicit-break.rs:13:9
help: you might have meant to break the loop with this value
|
LL | break 1;
- | ^^^^^ ^
+ | +++++ +
error[E0308]: mismatched types
--> $DIR/loop-no-implicit-break.rs:21:9
help: you might have meant to return this value
|
LL | return 1;
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/loop-no-implicit-break.rs:29:9
help: you might have meant to return this value
|
LL | return 1;
- | ^^^^^^ ^
+ | ++++++ +
error: aborting due to 4 previous errors
help: you might be missing a string literal to format with
|
LL | println!("{}", 3 + 4);
- | ^^^^^
+ | +++++
error: format argument must be a string literal
--> $DIR/bad_hello.rs:4:14
help: you might be missing a string literal to format with
|
LL | println!("{} {}", 3, 4);
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 2 previous errors
help: you might be missing a string literal to format with
|
LL | format_args!("{}", hang!());
- | ^^^^^
+ | +++++
error: aborting due to previous error
help: you might have meant to return this value
|
LL | { return true; }
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/empty-trailing-stmt.rs:5:13
help: format specifiers use curly braces
|
LL | println!("{:.2$} {}!\n", "Hello,", "World", 4);
- | ^^^^^^ ^^
+ | ~~~~~~ ~~
error: argument never used
--> $DIR/format-foreign.rs:3:29
= note: printf formatting not supported; see the documentation for `std::fmt`
help: format specifiers use curly braces
|
-LL | println!(r###"{:.2$}
-LL | {}!\n
+LL ~ println!(r###"{:.2$}
+LL ~ {}!\n
|
error: argument never used
help: format specifiers use curly braces
|
LL | println!("{1} {0} $$ {NAME}", 1, 2, NAME=3);
- | ^^^ ^^^ ^^^^^^
+ | ~~~ ~~~ ~~~~~~
error: aborting due to 6 previous errors
help: you might be missing a string literal to format with
|
LL | format!("{}", 123);
- | ^^^^^
+ | +++++
error: aborting due to 7 previous errors
help: you might be missing a string literal to format with
|
LL | println!("{}", 0);
- | ^^^^^
+ | +++++
error: format argument must be a string literal
--> $DIR/issue-30143.rs:6:15
help: you might be missing a string literal to format with
|
LL | eprintln!("{}", 'a');
- | ^^^^^
+ | +++++
error: format argument must be a string literal
--> $DIR/issue-30143.rs:9:17
help: you might be missing a string literal to format with
|
LL | writeln!(s, "{}", true).unwrap();
- | ^^^^^
+ | +++++
error: aborting due to 3 previous errors
help: add `;` to interpret the expansion as a statement
|
LL | make_item!(A);
- | ^
+ | +
error: expected expression, found keyword `struct`
--> $DIR/issue-34421-mac-expr-bad-stmt-good-add-semi.rs:3:9
help: add `;` to interpret the expansion as a statement
|
LL | make_item!(B);
- | ^
+ | +
error: aborting due to 2 previous errors
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
- | ^^^^^^^
+ | ~~~~~~~
error[E0599]: no method named `fake` found for type `{integer}` in the current scope
--> $DIR/macro-backtrace-invalid-internals.rs:23:13
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | 2.0_f32.neg()
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 8 previous errors
help: add `;` to interpret the expansion as a statement
|
LL | _ => { empty!(); }
- | ^
+ | +
error: aborting due to previous error
LL | #![deny(rust_2021_incompatible_or_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
--> $DIR/macro-or-patterns-back-compat.rs:13:23
| ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
--> $DIR/macro-or-patterns-back-compat.rs:19:21
| ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro
--> $DIR/macro-or-patterns-back-compat.rs:23:26
| ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #84869 <https://github.com/rust-lang/rust/issues/84869>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/or-patterns-macro-rules.html>
error: aborting due to 4 previous errors
help: you might be missing a string literal to format with
|
LL | format!("{}", invalid);
- | ^^^^^
+ | +++++
error: argument must be a string literal
--> $DIR/macros-nonfatal-errors.rs:110:14
help: the delimiters should be `(` and `)`
|
LL | #[allow ( foo_lint ) ]
- | ^ ^
+ | ~ ~
error: wrong meta list delimiters
--> $DIR/malformed-meta-delim.rs:8:9
help: the delimiters should be `(` and `)`
|
LL | #[allow ( foo_lint ) ]
- | ^ ^
+ | ~ ~
error: aborting due to 2 previous errors
help: use `_` to explicitly ignore each field
|
LL | Color::Rgb(_, _, _) => { }
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | Color::Rgb(..) => { }
- | ^^
+ | ~~
error: aborting due to previous error
help: change the type of the numeric literal from `usize` to `u32`
|
LL | let x: u32 = 22_u32;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: change the type of the numeric literal from `usize` to `u32`
|
LL | let x: u32 = 22_u32;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | let y: usize = x.foo().try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
help: disambiguate the associated function for candidate #1
|
LL | fn main() { Me2::me(&1_usize); }
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | fn main() { Me::me(&1_usize); }
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: disambiguate the associated function for candidate #1
|
LL | A::foo(t);
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(t);
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: aborting due to previous error
help: disambiguate the associated function for candidate #1
|
LL | A::foo(AB {});
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(AB {});
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: aborting due to previous error
help: disambiguate the associated function for candidate #1
|
LL | A::foo();
- | ^^^^^^
+ | ~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo();
- | ^^^^^^
+ | ~~~
error: aborting due to previous error
help: disambiguate the associated function for candidate #1
|
LL | Foo::method(&1_usize);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | Bar::method(&1_usize);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: add missing lifetime argument
|
LL | S.early::<'static, 'b>();
- | ^^^^
+ | ++++
error[E0107]: this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:18:7
help: add missing lifetime argument
|
LL | S::early::<'static, 'b>(S);
- | ^^^^
+ | ++++
error[E0107]: this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:65:8
help: disambiguate the associated function for candidate #1
|
LL | let z = X::foo(x);
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | let z = NuisanceFoo::foo(x);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #3
|
LL | let z = FinalFoo::foo(x);
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:139:24
help: use parentheses to call the method
|
LL | .get_x();
- | ^^
+ | ++
error[E0615]: attempted to take value of method `filter_map` on type `Filter<Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/method-missing-call.rs:27:20: 27:25]>, [closure@$DIR/method-missing-call.rs:28:23: 28:35]>`
--> $DIR/method-missing-call.rs:29:16
help: use parentheses to call the method
|
LL | .filter_map(_);
- | ^^^
+ | +++
error: aborting due to 2 previous errors
help: you must specify a concrete type for this numeric value, like `f32`
|
LL | let x = 2.0_f32.neg();
- | ^^^^^^^
+ | ~~~~~~~
error[E0689]: can't call method `neg` on ambiguous numeric type `{float}`
--> $DIR/method-on-ambiguous-numeric-type.rs:14:15
help: you must specify a type for this binding, like `f32`
|
LL | let y: f32 = 2.0;
- | ^^^^^^
+ | ~~~~~~
error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
--> $DIR/method-on-ambiguous-numeric-type.rs:19:26
help: you must specify a type for this binding, like `i32`
|
LL | ($ident:ident) => { let $ident: i32 = 42; }
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0689]: can't call method `pow` on ambiguous numeric type `{integer}`
--> $DIR/method-on-ambiguous-numeric-type.rs:30:9
help: you must specify a type for this binding, like `i32`
|
LL | ($ident:ident) => { let $ident: i32 = 42; }
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: aborting due to 5 previous errors
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Inline<T: ?Sized>
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 4 previous errors
help: try using a conversion method
|
LL | (1+2).to_string()
- | ^ ^^^^^^^^^^^^^
+ | + +++++++++++++
error[E0308]: mismatched types
--> $DIR/abridged.rs:59:5
help: try using a conversion method
|
LL | (-2).to_string()
- | ^ ^^^^^^^^^^^^^
+ | + +++++++++++++
error: aborting due to 8 previous errors
help: consider borrowing the value
|
LL | let _ = &*v as &u8;
- | ^^
+ | ++
error[E0605]: non-primitive cast: `*const u8` as `E`
--> $DIR/cast-rfc0401.rs:30:13
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _n = m.iter().map(|(_, b)| {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider changing the closure to take and ignore the expected arguments
|
LL | [1, 2, 3].sort_by(|_, _| panic!());
- | ^^^^^^
+ | ~~~~~~
error[E0593]: closure is expected to take 2 arguments, but it takes 1 argument
--> $DIR/closure-arg-count.rs:7:15
help: change the closure to take multiple arguments instead of a single tuple
|
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0593]: closure is expected to take 2 distinct arguments, but it takes a single 2-tuple as argument
--> $DIR/closure-arg-count.rs:11:15
help: change the closure to take multiple arguments instead of a single tuple
|
LL | [1, 2, 3].sort_by(|tuple, tuple2| panic!());
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
--> $DIR/closure-arg-count.rs:13:5
help: consider changing the closure to take and ignore the expected argument
|
LL | f(|_| panic!());
- | ^^^
+ | ~~~
error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
--> $DIR/closure-arg-count.rs:15:5
help: consider changing the closure to take and ignore the expected argument
|
LL | f( move |_| panic!());
- | ^^^
+ | ~~~
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:18:53
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:20:53
help: change the closure to accept a tuple instead of individual arguments
|
LL | let _it = vec![1, 2, 3].into_iter().enumerate().map(|(i, x)| i);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
--> $DIR/closure-arg-count.rs:22:53
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | ($arr.len() * size_of($arr[0])).try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0605]: non-primitive cast: `{integer}` as `()`
--> $DIR/issue-26480.rs:22:19
help: consider introducing a named lifetime parameter
|
LL | type Item<'a> = IteratorChunk<'a, T, S>;
- | ^^^^ ^^^
+ | ++++ +++
error: aborting due to previous error
help: change the type of the numeric literal from `u8` to `u16`
|
LL | foo(1u16);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-literal-cast.rs:8:10
help: change the type of the numeric literal from `f32` to `f64`
|
LL | foo1(2f64);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-literal-cast.rs:10:10
help: change the type of the numeric literal from `i16` to `i32`
|
LL | foo2(3i32);
- | ^^^^
+ | ~~~~
error: aborting due to 3 previous errors
help: add `struct` here to parse `Foo` as a public struct
|
LL | pub struct Foo { text }
- | ^^^^^^
+ | ++++++
error: expected one of `(` or `<`, found `{`
--> $DIR/recovered-block.rs:17:9
help: use the tuple variant pattern syntax instead
|
LL | if let S(a, b, c, d) = S(1, 2, 3, 4) {
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
help: a struct with a similar name exists
|
LL | impl X<X> {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<N> X<N> {}
- | ^^^
+ | +++
error[E0412]: cannot find type `N` in this scope
--> $DIR/missing-type-parameter2.rs:9:28
help: a type parameter with a similar name exists
|
LL | impl<T, const A: u8 = 2> X<T> {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<T, const A: u8 = 2, N> X<N> {}
- | ^^^
+ | +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:14:20
help: a struct with a similar name exists
|
LL | fn foo(_: T) where X: Send {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn foo<T>(_: T) where T: Send {}
- | ^^^
+ | +++
error[E0412]: cannot find type `T` in this scope
--> $DIR/missing-type-parameter2.rs:14:11
help: a struct with a similar name exists
|
LL | fn foo(_: X) where T: Send {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn foo<T>(_: T) where T: Send {}
- | ^^^
+ | +++
error[E0412]: cannot find type `A` in this scope
--> $DIR/missing-type-parameter2.rs:18:24
help: a struct with a similar name exists
|
LL | fn bar<const N: u8>(_: X) {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | fn bar<const N: u8, A>(_: A) {}
- | ^^^
+ | +++
error[E0747]: unresolved item provided when a constant was expected
--> $DIR/missing-type-parameter2.rs:6:8
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl X<{ N }> {}
- | ^ ^
+ | + +
error: defaults for const parameters are only allowed in `struct`, `enum`, `type`, or `trait` definitions
--> $DIR/missing-type-parameter2.rs:9:15
help: if this generic argument was intended as a const parameter, surround it with braces
|
LL | impl<T, const A: u8 = 2> X<{ N }> {}
- | ^ ^
+ | + +
error: aborting due to 8 previous errors
help: borrow this field in the pattern to avoid moving `node.next.0`
|
LL | Some(ref right) => consume(right),
- | ^^^
+ | +++
error: aborting due to previous error
help: consider further restricting this bound
|
LL | fn conspirator<F>(mut f: F) where F: FnMut(&mut R, bool) + Copy {
- | ^^^^^^
+ | ++++++
error: aborting due to 2 previous errors
+++ /dev/null
-// error-pattern: multiple plugin registration functions found
-
-#![feature(plugin_registrar)]
-
-// the registration function isn't typechecked yet
-#[plugin_registrar]
-pub fn one() {}
-
-#[plugin_registrar]
-pub fn two() {}
-
-fn main() {}
+++ /dev/null
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/multiple-plugin-registrars.rs:6:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
- |
- = note: `#[warn(deprecated)]` on by default
-
-warning: use of deprecated attribute `plugin_registrar`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/pull/64675
- --> $DIR/multiple-plugin-registrars.rs:9:1
- |
-LL | #[plugin_registrar]
- | ^^^^^^^^^^^^^^^^^^^ help: may be removed in a future compiler version
-
-error: multiple plugin registration functions found
- |
-note: one is here
- --> $DIR/multiple-plugin-registrars.rs:10:1
- |
-LL | pub fn two() {}
- | ^^^^^^^^^^^^^^^
-note: one is here
- --> $DIR/multiple-plugin-registrars.rs:7:1
- |
-LL | pub fn one() {}
- | ^^^^^^^^^^^^^^^
-
-error: aborting due to previous error; 2 warnings emitted
-
help: a tuple struct with a similar name exists
|
LL | check(m1::TS);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m2::S;
help: a tuple struct with a similar name exists
|
LL | check(xm1::TS);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m2::S;
help: use struct literal syntax instead
|
LL | check(m7::V {});
- | ^^^^^^^^
+ | ~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | check(m7::TV);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m8::V;
help: use struct literal syntax instead
|
LL | check(xm7::V { /* fields */ });
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | check(xm7::TV);
- | ^^
+ | ~~
help: consider importing one of these items instead
|
LL | use m8::V;
found reference `&_`
help: consider removing the borrow
|
-LL | [(); { loop { continue } } ];
- | --
+LL - [(); & { loop { continue } } ];
+LL + [(); { loop { continue } } ];
+ |
error[E0308]: mismatched types
--> $DIR/issue-52443.rs:4:17
help: borrow this field in the pattern to avoid moving `maybe.0`
|
LL | if let Some(ref thing) = maybe {
- | ^^^
+ | +++
error: aborting due to previous error
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | D("other").next(&_thing1);
- | ^
+ | +
error: aborting due to previous error
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | if let Ok(_) = counter.lock() { };
- | ^
+ | +
error: aborting due to previous error
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = rows.map(|row| row).next(); x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to previous error
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | D(&_thing1).end();
- | ^
+ | +
error: aborting due to previous error
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:13:55
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:16:55
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | { { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); }; } // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:19:55
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | let _ = { let mut _t1 = D(Box::new("t1")); D(&_t1).end(); } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:22:55
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | let _u = { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } ; // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:25:55
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let _x = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
- | ^^^^^^^ ^^^
+ | +++++++ +++
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:30:55
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | _y = { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } ; // `let x = ...; x`
- | ^^^^^^^ ^^^
+ | +++++++ +++
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:37:55
help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
|
LL | fn f_local_ref() { let mut _t1 = D(Box::new("t1")); D(&_t1).unit(); } // suggest `;`
- | ^
+ | +
error[E0597]: `_t1` does not live long enough
--> $DIR/issue-54556-used-vs-unused-tails.rs:40:55
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | fn f() -> String { let mut _t1 = D(Box::new("t1")); let x = D(&_t1).end(); x } // `let x = ...; x`
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to 9 previous errors
help: add explicit lifetime `ReEarlyBound(0, 'a)` to the type of `x`
|
LL | fn foo<'a, T>(x: &ReEarlyBound(0, 'a) T) -> impl Foo<'a> {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | extern crate core as other_core;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", "here's a brace: {");
- | ^^^^^
+ | +++++
warning: panic message contains a brace
--> $DIR/non-fmt-panic.rs:12:31
help: add a "{}" format string to use the message literally
|
LL | std::panic!("{}", "another one: }");
- | ^^^^^
+ | +++++
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:13:25
help: add the missing argument
|
LL | core::panic!("Hello {}", ...);
- | ^^^^^
+ | +++++
help: or add a "{}" format string to use the message literally
|
LL | core::panic!("{}", "Hello {}");
- | ^^^^^
+ | +++++
warning: panic message contains unused formatting placeholders
--> $DIR/non-fmt-panic.rs:14:21
help: add the missing arguments
|
LL | assert!(false, "{:03x} {test} bla", ...);
- | ^^^^^
+ | +++++
help: or add a "{}" format string to use the message literally
|
LL | assert!(false, "{}", "{:03x} {test} bla");
- | ^^^^^
+ | +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:16:20
help: add a "{}" format string to Display the message
|
LL | assert!(false, "{}", S);
- | ^^^^^
+ | +++++
warning: panic message contains braces
--> $DIR/non-fmt-panic.rs:18:27
help: add a "{}" format string to use the message literally
|
LL | debug_assert!(false, "{}", "{{}} bla");
- | ^^^^^
+ | +++++
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:19:12
help: add a "{}" format string to Display the message
|
LL | panic!("{}", C);
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(C);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:20:12
help: add a "{}" format string to Display the message
|
LL | panic!("{}", S);
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(S);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:21:17
help: add a "{}" format string to Display the message
|
LL | std::panic!("{}", 123);
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(123);
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:22:18
help: add a "{}" format string to Display the message
|
LL | core::panic!("{}", &*"abc");
- | ^^^^^
+ | +++++
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:23:12
help: add the missing argument
|
LL | panic!(concat!("{", "}"), ...);
- | ^^^^^
+ | +++++
help: or add a "{}" format string to use the message literally
|
LL | panic!("{}", concat!("{", "}"));
- | ^^^^^
+ | +++++
warning: panic message contains braces
--> $DIR/non-fmt-panic.rs:24:5
help: add a "{}" format string to use the message literally
|
LL | panic!("{}", concat!("{", "{"));
- | ^^^^^
+ | +++++
warning: panic message contains an unused formatting placeholder
--> $DIR/non-fmt-panic.rs:26:37
help: add a "{}" format string to Display the message
|
LL | panic!("{}", a!());
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(a!());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:38:12
= note: the panic!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
|
-LL | panic!("{}", 1);
- | -- --
+LL - panic!(format!("{}", 1));
+LL + panic!("{}", 1);
+ |
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:39:20
= note: the assert!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
|
-LL | assert!(false, "{}", 1);
- | -- --
+LL - assert!(false, format!("{}", 1));
+LL + assert!(false, "{}", 1);
+ |
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:40:26
= note: the debug_assert!() macro supports formatting, so there's no need for the format!() macro here
help: remove the `format!(..)` macro call
|
-LL | debug_assert!(false, "{}", 1);
- | -- --
+LL - debug_assert!(false, format!("{}", 1));
+LL + debug_assert!(false, "{}", 1);
+ |
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:42:12
help: add a "{}" format string to Display the message
|
LL | panic!["{}", 123];
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(123);
- | ^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ~~~~~~~~~~~~~~~~~~~~~~ ~
warning: panic message is not a string literal
--> $DIR/non-fmt-panic.rs:43:12
help: add a "{}" format string to Display the message
|
LL | panic!{"{}", 123};
- | ^^^^^
+ | +++++
help: or use std::panic::panic_any instead
|
LL | std::panic::panic_any(123);
- | ^^^^^^^^^^^^^^^^^^^^^^ ^
+ | ~~~~~~~~~~~~~~~~~~~~~~ ~
warning: 20 warnings emitted
help: change the type of the numeric literal from `i8` to `i32`
|
LL | const C: i32 = 1i32;
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/const-scope.rs:2:15
help: change the type of the numeric literal from `i8` to `i32`
|
LL | let c: i32 = 1i32;
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/const-scope.rs:6:17
help: change the type of the numeric literal from `i8` to `i32`
|
LL | let c: i32 = 1i32;
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/const-scope.rs:11:17
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | let d: i8 = c.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | test(array.len().try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
|
LL | let x: u16 = foo().try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-2.rs:7:18
help: you can convert `x_u8` from `u8` to `u16`, matching the type of `x_u16`
|
LL | u16::from(x_u8) > x_u16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:25:16
help: you can convert `x_u8` from `u8` to `u32`, matching the type of `x_u32`
|
LL | u32::from(x_u8) > x_u32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:27:16
help: you can convert `x_u8` from `u8` to `u64`, matching the type of `x_u64`
|
LL | u64::from(x_u8) > x_u64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:29:16
help: you can convert `x_u8` from `u8` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u8) > x_u128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:31:16
help: you can convert `x_u8` from `u8` to `usize`, matching the type of `x_usize`
|
LL | usize::from(x_u8) > x_usize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:34:17
help: you can convert `x_u16` from `u16` to `u32`, matching the type of `x_u32`
|
LL | u32::from(x_u16) > x_u32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:38:17
help: you can convert `x_u16` from `u16` to `u64`, matching the type of `x_u64`
|
LL | u64::from(x_u16) > x_u64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:40:17
help: you can convert `x_u16` from `u16` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u16) > x_u128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:42:17
help: you can convert `x_u16` from `u16` to `usize`, matching the type of `x_usize`
|
LL | usize::from(x_u16) > x_usize;
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:45:17
help: you can convert `x_u32` from `u32` to `u64`, matching the type of `x_u64`
|
LL | u64::from(x_u32) > x_u64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:51:17
help: you can convert `x_u32` from `u32` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u32) > x_u128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:53:17
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:56:17
help: you can convert `x_u64` from `u64` to `u128`, matching the type of `x_u128`
|
LL | u128::from(x_u64) > x_u128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:64:17
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:67:18
help: you can convert a `usize` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:78:19
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:84:19
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:86:19
help: you can convert a `u128` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:92:16
help: you can convert `x_i8` from `i8` to `i16`, matching the type of `x_i16`
|
LL | i16::from(x_i8) > x_i16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:94:16
help: you can convert `x_i8` from `i8` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_i8) > x_i32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:96:16
help: you can convert `x_i8` from `i8` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_i8) > x_i64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:98:16
help: you can convert `x_i8` from `i8` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i8) > x_i128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:100:16
help: you can convert `x_i8` from `i8` to `isize`, matching the type of `x_isize`
|
LL | isize::from(x_i8) > x_isize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:103:17
help: you can convert `x_i16` from `i16` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_i16) > x_i32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:107:17
help: you can convert `x_i16` from `i16` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_i16) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:109:17
help: you can convert `x_i16` from `i16` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i16) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:111:17
help: you can convert `x_i16` from `i16` to `isize`, matching the type of `x_isize`
|
LL | isize::from(x_i16) > x_isize;
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:114:17
help: you can convert `x_i32` from `i32` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_i32) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:120:17
help: you can convert `x_i32` from `i32` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i32) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:122:17
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:125:17
help: you can convert `x_i64` from `i64` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_i64) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:133:17
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:136:18
help: you can convert an `isize` to an `i128` and panic if the converted value doesn't fit
|
LL | x_i128 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:147:19
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:153:19
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:155:19
help: you can convert an `i128` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_i128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:161:16
help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit
|
LL | x_u8 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:163:16
help: you can convert `x_u8` from `u8` to `i16`, matching the type of `x_i16`
|
LL | i16::from(x_u8) > x_i16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:165:16
help: you can convert `x_u8` from `u8` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_u8) > x_i32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:167:16
help: you can convert `x_u8` from `u8` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_u8) > x_i64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:169:16
help: you can convert `x_u8` from `u8` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u8) > x_i128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:171:16
help: you can convert `x_u8` from `u8` to `isize`, matching the type of `x_isize`
|
LL | isize::from(x_u8) > x_isize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:174:17
help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit
|
LL | x_u16 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:176:17
help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit
|
LL | x_u16 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:178:17
help: you can convert `x_u16` from `u16` to `i32`, matching the type of `x_i32`
|
LL | i32::from(x_u16) > x_i32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:180:17
help: you can convert `x_u16` from `u16` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_u16) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:182:17
help: you can convert `x_u16` from `u16` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u16) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:184:17
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
LL | x_u16 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:187:17
help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:189:17
help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:191:17
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:193:17
help: you can convert `x_u32` from `u32` to `i64`, matching the type of `x_i64`
|
LL | i64::from(x_u32) > x_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:195:17
help: you can convert `x_u32` from `u32` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u32) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:197:17
help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit
|
LL | x_u32 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:200:17
help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:202:17
help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:204:17
help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:206:17
help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:208:17
help: you can convert `x_u64` from `u64` to `i128`, matching the type of `x_i128`
|
LL | i128::from(x_u64) > x_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:210:17
help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit
|
LL | x_u64 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:213:18
help: you can convert an `i8` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:215:18
help: you can convert an `i16` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:217:18
help: you can convert an `i32` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:219:18
help: you can convert an `i64` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:221:18
help: you can convert an `i128` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_i128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:223:18
help: you can convert an `isize` to a `u128` and panic if the converted value doesn't fit
|
LL | x_u128 > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:226:19
help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:228:19
help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:230:19
help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:232:19
help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:234:19
help: you can convert an `i128` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_i128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:236:19
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | x_usize > x_isize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:242:16
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u8.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:244:16
help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:246:16
help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:248:16
help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:250:16
help: you can convert a `u128` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:252:16
help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit
|
LL | x_i8 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:255:17
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:259:17
help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:261:17
help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:263:17
help: you can convert a `u128` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:265:17
help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit
|
LL | x_i16 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:268:17
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:274:17
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:276:17
help: you can convert a `u128` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:278:17
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
|
LL | x_i32 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:281:17
help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:289:17
help: you can convert a `u128` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:291:17
help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit
|
LL | x_i64 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:294:18
help: you can convert a `u128` to an `i128` and panic if the converted value doesn't fit
|
LL | x_i128 > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:304:18
help: you can convert a `usize` to an `i128` and panic if the converted value doesn't fit
|
LL | x_i128 > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:307:19
help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u16.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:311:19
help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u32.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:313:19
help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u64.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:315:19
help: you can convert a `u128` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_u128.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-binop.rs:317:19
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | x_isize > x_usize.try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 132 previous errors
help: you can convert `x_u8` from `u8` to `isize`, matching the type of `-1_isize`
|
LL | isize::from(x_u8) > -1_isize;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:23:15
help: you can convert `x_u64` from `u64` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u64) > -1_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:29:13
help: you can convert `x_u32` from `u32` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u32) > -1_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:31:13
help: you can convert `x_u16` from `u16` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u16) > -1_i128;
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:33:12
help: you can convert `x_u8` from `u8` to `i128`, matching the type of `-1_i128`
|
LL | i128::from(x_u8) > -1_i128;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:36:15
help: you can convert `x_u32` from `u32` to `i64`, matching the type of `-1_i64`
|
LL | i64::from(x_u32) > -1_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:44:13
help: you can convert `x_u16` from `u16` to `i64`, matching the type of `-1_i64`
|
LL | i64::from(x_u16) > -1_i64;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:46:12
help: you can convert `x_u8` from `u8` to `i64`, matching the type of `-1_i64`
|
LL | i64::from(x_u8) > -1_i64;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:49:15
help: you can convert `x_u16` from `u16` to `i32`, matching the type of `-1_i32`
|
LL | i32::from(x_u16) > -1_i32;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:59:12
help: you can convert `x_u8` from `u8` to `i32`, matching the type of `-1_i32`
|
LL | i32::from(x_u8) > -1_i32;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:62:15
help: you can convert `x_u8` from `u8` to `i16`, matching the type of `-1_i16`
|
LL | i16::from(x_u8) > -1_i16;
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast-no-fix.rs:75:15
help: you can convert a `u64` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:25:18
help: you can convert a `u32` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:27:18
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:33:18
help: you can convert an `i64` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:35:18
help: you can convert an `i32` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:37:18
help: you can convert an `i16` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:39:18
help: you can convert an `i8` to a `usize` and panic if the converted value doesn't fit
|
LL | foo::<usize>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:44:18
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:46:18
help: you can convert a `u64` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:48:18
help: you can convert a `u32` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:50:18
help: you can convert a `u16` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:52:18
help: you can convert an `i64` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:57:18
help: you can convert an `i32` to an `isize` and panic if the converted value doesn't fit
|
LL | foo::<isize>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:59:18
help: you can convert a `usize` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:69:16
help: you can convert an `isize` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:77:16
help: you can convert an `i64` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:79:16
help: you can convert an `i32` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:81:16
help: you can convert an `i16` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:83:16
help: you can convert an `i8` to a `u64` and panic if the converted value doesn't fit
|
LL | foo::<u64>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:88:16
help: you can convert a `usize` to an `i64` and panic if the converted value doesn't fit
|
LL | foo::<i64>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:90:16
help: you can convert a `u64` to an `i64` and panic if the converted value doesn't fit
|
LL | foo::<i64>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:92:16
help: you can convert an `isize` to an `i64` and panic if the converted value doesn't fit
|
LL | foo::<i64>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:101:16
help: you can convert a `usize` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:112:16
help: you can convert a `u64` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:115:16
help: you can convert an `isize` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:121:16
help: you can convert an `i64` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:123:16
help: you can convert an `i32` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:125:16
help: you can convert an `i16` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:127:16
help: you can convert an `i8` to a `u32` and panic if the converted value doesn't fit
|
LL | foo::<u32>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:132:16
help: you can convert a `usize` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:134:16
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:136:16
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:138:16
help: you can convert an `isize` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:144:16
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | foo::<i32>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:147:16
help: you can convert a `usize` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:156:16
help: you can convert a `u64` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:158:16
help: you can convert a `u32` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:161:16
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:165:16
help: you can convert an `i64` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:167:16
help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:169:16
help: you can convert an `i16` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:171:16
help: you can convert an `i8` to a `u16` and panic if the converted value doesn't fit
|
LL | foo::<u16>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:176:16
help: you can convert a `usize` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:178:16
help: you can convert a `u64` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:180:16
help: you can convert a `u32` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:182:16
help: you can convert a `u16` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:184:16
help: you can convert an `isize` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:188:16
help: you can convert an `i64` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:190:16
help: you can convert an `i32` to an `i16` and panic if the converted value doesn't fit
|
LL | foo::<i16>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:193:16
help: you can convert a `usize` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:200:15
help: you can convert a `u64` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:202:15
help: you can convert a `u32` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:204:15
help: you can convert a `u16` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:207:15
help: you can convert an `isize` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:209:15
help: you can convert an `i64` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:211:15
help: you can convert an `i32` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:213:15
help: you can convert an `i16` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:215:15
help: you can convert an `i8` to a `u8` and panic if the converted value doesn't fit
|
LL | foo::<u8>(x_i8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:220:15
help: you can convert a `usize` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_usize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:222:15
help: you can convert a `u64` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:224:15
help: you can convert a `u32` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:226:15
help: you can convert a `u16` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:228:15
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_u8.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:230:15
help: you can convert an `isize` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_isize.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:232:15
help: you can convert an `i64` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_i64.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:234:15
help: you can convert an `i32` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_i32.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:236:15
help: you can convert an `i16` to an `i8` and panic if the converted value doesn't fit
|
LL | foo::<i8>(x_i16.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:242:16
help: you can cast a `usize` to an `f64`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f64>(x_usize as f64);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:244:16
help: you can cast a `u64` to an `f64`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f64>(x_u64 as f64);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:246:16
help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_u32.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:248:16
help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_u16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:250:16
help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_u8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:252:16
help: you can convert an `isize` to an `f64`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f64>(x_isize as f64);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:254:16
help: you can convert an `i64` to an `f64`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f64>(x_i64 as f64);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:256:16
help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_i32.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:258:16
help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_i16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:260:16
help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(x_i8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:263:16
help: you can cast a `usize` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f32>(x_usize as f32);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:268:16
help: you can cast a `u64` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f32>(x_u64 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:270:16
help: you can cast a `u32` to an `f32`, producing the floating point representation of the integer,
| rounded if necessary
LL | foo::<f32>(x_u32 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:272:16
help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_u16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:274:16
help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_u8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:276:16
help: you can convert an `isize` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_isize as f32);
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:278:16
help: you can convert an `i64` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_i64 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:280:16
help: you can convert an `i32` to an `f32`, producing the floating point representation of the integer, rounded if necessary
|
LL | foo::<f32>(x_i32 as f32);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:282:16
help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_i16.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:284:16
help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(x_i8.into());
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-cast.rs:289:16
help: change the type of the numeric literal from `u64` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:9:18
help: change the type of the numeric literal from `u32` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:11:18
help: change the type of the numeric literal from `u16` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:13:18
help: change the type of the numeric literal from `u8` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:15:18
help: change the type of the numeric literal from `isize` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:17:18
help: change the type of the numeric literal from `i64` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:19:18
help: change the type of the numeric literal from `i32` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:21:18
help: change the type of the numeric literal from `i16` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:23:18
help: change the type of the numeric literal from `i8` to `usize`
|
LL | foo::<usize>(42_usize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:25:18
help: change the type of the numeric literal from `f64` to `usize`
|
LL | foo::<usize>(42usize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:27:18
help: change the type of the numeric literal from `f32` to `usize`
|
LL | foo::<usize>(42usize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:30:18
help: change the type of the numeric literal from `usize` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:32:18
help: change the type of the numeric literal from `u64` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:34:18
help: change the type of the numeric literal from `u32` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:36:18
help: change the type of the numeric literal from `u16` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:38:18
help: change the type of the numeric literal from `u8` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:41:18
help: change the type of the numeric literal from `i64` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:43:18
help: change the type of the numeric literal from `i32` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:45:18
help: change the type of the numeric literal from `i16` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:47:18
help: change the type of the numeric literal from `i8` to `isize`
|
LL | foo::<isize>(42_isize);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:49:18
help: change the type of the numeric literal from `f64` to `isize`
|
LL | foo::<isize>(42isize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:51:18
help: change the type of the numeric literal from `f32` to `isize`
|
LL | foo::<isize>(42isize);
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:54:16
help: change the type of the numeric literal from `usize` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:57:16
help: change the type of the numeric literal from `u32` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:59:16
help: change the type of the numeric literal from `u16` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:61:16
help: change the type of the numeric literal from `u8` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:63:16
help: change the type of the numeric literal from `isize` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:65:16
help: change the type of the numeric literal from `i64` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:67:16
help: change the type of the numeric literal from `i32` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:69:16
help: change the type of the numeric literal from `i16` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:71:16
help: change the type of the numeric literal from `i8` to `u64`
|
LL | foo::<u64>(42_u64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:73:16
help: change the type of the numeric literal from `f64` to `u64`
|
LL | foo::<u64>(42u64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:75:16
help: change the type of the numeric literal from `f32` to `u64`
|
LL | foo::<u64>(42u64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:78:16
help: change the type of the numeric literal from `usize` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:80:16
help: change the type of the numeric literal from `u64` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:82:16
help: change the type of the numeric literal from `u32` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:84:16
help: change the type of the numeric literal from `u16` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:86:16
help: change the type of the numeric literal from `u8` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:88:16
help: change the type of the numeric literal from `isize` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:91:16
help: change the type of the numeric literal from `i32` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:93:16
help: change the type of the numeric literal from `i16` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:95:16
help: change the type of the numeric literal from `i8` to `i64`
|
LL | foo::<i64>(42_i64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:97:16
help: change the type of the numeric literal from `f64` to `i64`
|
LL | foo::<i64>(42i64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:99:16
help: change the type of the numeric literal from `f32` to `i64`
|
LL | foo::<i64>(42i64);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:102:16
help: change the type of the numeric literal from `usize` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:104:16
help: change the type of the numeric literal from `u64` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:107:16
help: change the type of the numeric literal from `u16` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:109:16
help: change the type of the numeric literal from `u8` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:111:16
help: change the type of the numeric literal from `isize` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:113:16
help: change the type of the numeric literal from `i64` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:115:16
help: change the type of the numeric literal from `i32` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:117:16
help: change the type of the numeric literal from `i16` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:119:16
help: change the type of the numeric literal from `i8` to `u32`
|
LL | foo::<u32>(42_u32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:121:16
help: change the type of the numeric literal from `f64` to `u32`
|
LL | foo::<u32>(42u32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:123:16
help: change the type of the numeric literal from `f32` to `u32`
|
LL | foo::<u32>(42u32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:126:16
help: change the type of the numeric literal from `usize` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:128:16
help: change the type of the numeric literal from `u64` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:130:16
help: change the type of the numeric literal from `u32` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:132:16
help: change the type of the numeric literal from `u16` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:134:16
help: change the type of the numeric literal from `u8` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:136:16
help: change the type of the numeric literal from `isize` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:138:16
help: change the type of the numeric literal from `i64` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:141:16
help: change the type of the numeric literal from `i16` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:143:16
help: change the type of the numeric literal from `i8` to `i32`
|
LL | foo::<i32>(42_i32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:145:16
help: change the type of the numeric literal from `f64` to `i32`
|
LL | foo::<i32>(42i32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:147:16
help: change the type of the numeric literal from `f32` to `i32`
|
LL | foo::<i32>(42i32);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:150:16
help: change the type of the numeric literal from `usize` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:152:16
help: change the type of the numeric literal from `u64` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:154:16
help: change the type of the numeric literal from `u32` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:157:16
help: change the type of the numeric literal from `u8` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:159:16
help: change the type of the numeric literal from `isize` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:161:16
help: change the type of the numeric literal from `i64` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:163:16
help: change the type of the numeric literal from `i32` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:165:16
help: change the type of the numeric literal from `i16` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:167:16
help: change the type of the numeric literal from `i8` to `u16`
|
LL | foo::<u16>(42_u16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:169:16
help: change the type of the numeric literal from `f64` to `u16`
|
LL | foo::<u16>(42u16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:171:16
help: change the type of the numeric literal from `f32` to `u16`
|
LL | foo::<u16>(42u16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:174:16
help: change the type of the numeric literal from `usize` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:176:16
help: change the type of the numeric literal from `u64` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:178:16
help: change the type of the numeric literal from `u32` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:180:16
help: change the type of the numeric literal from `u16` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:182:16
help: change the type of the numeric literal from `u8` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:184:16
help: change the type of the numeric literal from `isize` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:186:16
help: change the type of the numeric literal from `i64` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:188:16
help: change the type of the numeric literal from `i32` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:191:16
help: change the type of the numeric literal from `i8` to `i16`
|
LL | foo::<i16>(42_i16);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:193:16
help: change the type of the numeric literal from `f64` to `i16`
|
LL | foo::<i16>(42i16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:195:16
help: change the type of the numeric literal from `f32` to `i16`
|
LL | foo::<i16>(42i16);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:198:15
help: change the type of the numeric literal from `usize` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:200:15
help: change the type of the numeric literal from `u64` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:202:15
help: change the type of the numeric literal from `u32` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:204:15
help: change the type of the numeric literal from `u16` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:207:15
help: change the type of the numeric literal from `isize` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:209:15
help: change the type of the numeric literal from `i64` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:211:15
help: change the type of the numeric literal from `i32` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:213:15
help: change the type of the numeric literal from `i16` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:215:15
help: change the type of the numeric literal from `i8` to `u8`
|
LL | foo::<u8>(42_u8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:217:15
help: change the type of the numeric literal from `f64` to `u8`
|
LL | foo::<u8>(42u8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:219:15
help: change the type of the numeric literal from `f32` to `u8`
|
LL | foo::<u8>(42u8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:222:15
help: change the type of the numeric literal from `usize` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:224:15
help: change the type of the numeric literal from `u64` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:226:15
help: change the type of the numeric literal from `u32` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:228:15
help: change the type of the numeric literal from `u16` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:230:15
help: change the type of the numeric literal from `u8` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:232:15
help: change the type of the numeric literal from `isize` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:234:15
help: change the type of the numeric literal from `i64` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:236:15
help: change the type of the numeric literal from `i32` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:238:15
help: change the type of the numeric literal from `i16` to `i8`
|
LL | foo::<i8>(42_i8);
- | ^^^^^
+ | ~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:241:15
help: change the type of the numeric literal from `f64` to `i8`
|
LL | foo::<i8>(42i8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:243:15
help: change the type of the numeric literal from `f32` to `i8`
|
LL | foo::<i8>(42i8);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:246:16
help: change the type of the numeric literal from `usize` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:248:16
help: change the type of the numeric literal from `u64` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:250:16
help: you can convert a `u32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_u32.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:252:16
help: you can convert a `u16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_u16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:254:16
help: you can convert a `u8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_u8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:256:16
help: change the type of the numeric literal from `isize` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:258:16
help: change the type of the numeric literal from `i64` to `f64`
|
LL | foo::<f64>(42_f64);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:260:16
help: you can convert an `i32` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_i32.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:262:16
help: you can convert an `i16` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_i16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:264:16
help: you can convert an `i8` to an `f64`, producing the floating point representation of the integer
|
LL | foo::<f64>(42_i8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:267:16
help: change the type of the numeric literal from `f32` to `f64`
|
LL | foo::<f64>(42.0_f64);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:270:16
help: change the type of the numeric literal from `usize` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:272:16
help: change the type of the numeric literal from `u64` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:274:16
help: change the type of the numeric literal from `u32` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:276:16
help: you can convert a `u16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_u16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:278:16
help: you can convert a `u8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_u8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:280:16
help: change the type of the numeric literal from `isize` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:282:16
help: change the type of the numeric literal from `i64` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:284:16
help: change the type of the numeric literal from `i32` to `f32`
|
LL | foo::<f32>(42_f32);
- | ^^^^^^
+ | ~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:286:16
help: you can convert an `i16` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_i16.into());
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:288:16
help: you can convert an `i8` to an `f32`, producing the floating point representation of the integer
|
LL | foo::<f32>(42_i8.into());
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:290:16
help: change the type of the numeric literal from `f64` to `f32`
|
LL | foo::<f32>(42.0_f32);
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0308]: mismatched types
--> $DIR/numeric-suffix.rs:294:16
help: to declare that the trait object captures data from argument `ss`, you can add an explicit `'_` lifetime bound
|
LL | fn load(ss: &mut SomeStruct) -> Box<dyn SomeTrait + '_> {
- | ^^^^
+ | ++++
error[E0621]: explicit lifetime required in the type of `ss`
--> $DIR/object-lifetime-default-from-box-error.rs:31:12
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) {}
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to previous error
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) {}
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized {}
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to previous error
+++ /dev/null
-error[E0038]: the trait `Foo` cannot be made into an object
- --> $DIR/object-safety-no-static.rs:8:1
- |
-LL | fn foo();
- | --- associated function `foo` has no `self` parameter
-...
-LL | fn foo_implicit<T:Foo+'static>(b: Box<T>) -> Box<dyn Foo + 'static> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0038`.
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-`
|
LL | x < - y;
- | ^^^
+ | ~~~
error: expected expression, found keyword `in`
--> $DIR/bad.rs:10:5
help: try using a conversion method
|
LL | f = (box g).to_string();
- | ^ ^^^^^^^^^^^^^
+ | + +++++++++++++
error: aborting due to previous error
help: try using a conversion method
|
LL | f = (box f).to_string();
- | ^ ^^^^^^^^^^^^^
+ | + +++++++++++++
error: aborting due to previous error
help: consider further restricting this bound
|
LL | fn foo<F:FnOnce() + Copy>(blk: F) {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let (0 | (1 | 2)) = 0 { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `i32::MIN..=-1_i32` and `3_i32..=i32::MAX` not covered
--> $DIR/issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs:3:11
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | pub struct Bad<T> {
- | --
+LL - pub struct Bad<T: ?Sized> {
+LL + pub struct Bad<T> {
+ |
help: borrowed types always have a statically known size
|
LL | data: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | data: Box<T>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: you might be missing a string literal to format with
|
LL | panic!("{}", 123);
- | ^^^^^
+ | +++++
error: 1 positional argument in format string, but no arguments were given
--> $DIR/panic-2021.rs:5:13
help: you might be missing a string literal to format with
|
LL | assert!(false, "{}", 123);
- | ^^^^^
+ | +++++
error: 1 positional argument in format string, but no arguments were given
--> $DIR/panic-2021.rs:8:21
help: `(sess as *const Session)` is a raw pointer; try dereferencing it
|
LL | (*(sess as *const Session)).opts;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0609]: no field `0` on type `[u32; 1]`
--> $DIR/parenthesized-deref-suggestion.rs:10:21
help: if the original crate name uses dashes you need to use underscores in the code
|
LL | extern crate krate_name_here;
- | ^ ^
+ | ~ ~
error[E0463]: can't find crate for `krate_name_here`
--> $DIR/bad-crate-name.rs:1:1
help: you can escape reserved keywords to use them as identifiers
|
LL | fn r#false() { }
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | fn r#true() { }
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
|
help: you might have forgotten to add the struct literal inside the block
|
-LL | fn foo() -> Foo { SomeStruct {
+LL ~ fn foo() -> Foo { SomeStruct {
LL | val: (),
-LL | } }
+LL ~ } }
|
error: struct literal body without path
|
help: you might have forgotten to add the struct literal inside the block
|
-LL | let x = { SomeStruct {
+LL ~ let x = { SomeStruct {
LL | val: (),
-LL | } };
+LL ~ } };
|
error[E0308]: mismatched types
help: if you meant to use the unicode code point for 'é', use a \xHH escape
|
LL | b'\xE9';
- | ^^^^
+ | ~~~~
error[E0763]: unterminated byte constant
--> $DIR/byte-literals.rs:11:6
help: if you meant to use the unicode code point for 'é', use a \xHH escape
|
LL | b"\xE9";
- | ^^^^
+ | ~~~~
error: raw byte string must be ASCII
--> $DIR/byte-string-literals.rs:7:10
help: split the comparison into two
|
LL | 1 < 2 && 2 <= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:9:7
help: split the comparison into two
|
LL | 1 < 2 && 2 < 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:13:7
help: split the comparison into two
|
LL | 1 <= 2 && 2 < 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:18:7
help: split the comparison into two
|
LL | 1 <= 2 && 2 <= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:23:7
help: split the comparison into two
|
LL | 1 > 2 && 2 >= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:28:7
help: split the comparison into two
|
LL | 1 > 2 && 2 > 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:32:7
help: split the comparison into two
|
LL | 1 >= 2 && 2 > 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:36:7
help: split the comparison into two
|
LL | 1 >= 2 && 2 >= 3;
- | ^^^^
+ | ++++
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:41:7
help: parenthesize the comparison
|
LL | 1 == (2 < 3);
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:45:7
help: parenthesize the comparison
|
LL | (1 > 2) == false;
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/chained-comparison-suggestion.rs:49:7
help: split the comparison into two
|
LL | 1 == 2 && 2 == 3;
- | ^^^^
+ | ++++
error[E0308]: mismatched types
--> $DIR/chained-comparison-suggestion.rs:4:14
help: add a space before `!` to use a regular comment
|
LL | // !self.allow_ty_infer()
- | ^^^^
+ | ~~~~
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! bar */`
--> $DIR/doc-comment-in-stmt.rs:9:5
help: add a space before `!` to use a regular comment
|
LL | /* ! bar */
- | ^^^^
+ | ~~~~
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/** baz */`
--> $DIR/doc-comment-in-stmt.rs:13:7
help: add a space before `*` to use a regular comment
|
LL | 1 /* * baz */
- | ^^^^
+ | ~~~~
error: expected one of `.`, `;`, `?`, `}`, or an operator, found doc comment `/*! quux */`
--> $DIR/doc-comment-in-stmt.rs:17:7
help: add a space before `!` to use a regular comment
|
LL | 2 /* ! quux */
- | ^^^^
+ | ~~~~
error: aborting due to 4 previous errors
help: use `..` for an exclusive range
|
LL | let _redemptive = 1..21;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | let _redemptive = 1..=21;
- | ^^^
+ | ~~~
error: aborting due to previous error
help: you might have meant to return this value
|
LL | if let Some(x) = a { return true; } else { false }
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt-2.rs:3:40
help: you might have meant to return this value
|
LL | if let Some(x) = a { true } else { return false; }
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt-2.rs:6:5
help: parentheses are required to parse this as an expression
|
LL | (if let Some(x) = a { true } else { false })
- | ^ ^
+ | + +
error: aborting due to 3 previous errors
help: parentheses are required to parse this as an expression
|
LL | ({2}) + {2}
- | ^ ^
+ | + +
error: expected expression, found `+`
--> $DIR/expr-as-stmt.rs:13:9
help: parentheses are required to parse this as an expression
|
LL | ({2}) + 2
- | ^ ^
+ | + +
error: expected expression, found `+`
--> $DIR/expr-as-stmt.rs:19:12
help: parentheses are required to parse this as an expression
|
LL | ({ 42 }) + foo;
- | ^ ^
+ | + +
error: expected expression, found `>`
--> $DIR/expr-as-stmt.rs:32:7
|
help: parentheses are required to parse this as an expression
|
-LL | (match x {
+LL ~ (match x {
LL | _ => 1,
-LL | }) > 0
+LL ~ }) > 0
|
error[E0308]: mismatched types
help: you might have meant to return this value
|
LL | {return 2;} + {2}
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:13:6
help: you might have meant to return this value
|
LL | {return 2;} + 2
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:19:7
help: you might have meant to return this value
|
LL | { return 42; } + foo;
- | ^^^^^^ ^
+ | ++++++ +
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:25:7
help: you might have meant to return this value
|
LL | { return 3; } * 3
- | ^^^^^^ ^
+ | ++++++ +
error[E0614]: type `{integer}` cannot be dereferenced
--> $DIR/expr-as-stmt.rs:25:11
help: parentheses are required to parse this as an expression
|
LL | ({ 3 }) * 3
- | ^ ^
+ | + +
error: aborting due to 9 previous errors
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:5:20
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:9:14
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:11:20
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:16:14
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:17:20
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:21:14
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn foo() { 42 }
- | ^ ^
+ | ~ ~
error: function body cannot be `= expression;`
--> $DIR/fn-body-eq-expr-semi.rs:22:20
help: surround the expression with `{` and `}` instead of `=` and `;`
|
LL | fn bar() -> u8 { 42 }
- | ^ ^
+ | ~ ~
error: incorrect function inside `extern` block
--> $DIR/fn-body-eq-expr-semi.rs:9:8
help: remove the qualifiers
|
LL | fn fe1();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:51:19
help: remove the qualifiers
|
LL | fn fe2();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:52:18
help: remove the qualifiers
|
LL | fn fe3();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:53:23
help: remove the qualifiers
|
LL | fn fe4();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/fn-header-semantic-fail.rs:54:42
help: remove the qualifiers
|
LL | fn fe5();
- | ^^
+ | ~~
error: functions cannot be both `const` and `async`
--> $DIR/fn-header-semantic-fail.rs:54:9
help: try switching the order
|
LL | let _ = async move { };
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: if this is a `self` type, give it a parameter name
|
LL | fn fizz(self: i32) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn fizz(i32: TypeName) {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn fizz(_: i32) {}
- | ^^^^^^
+ | ~~~~~~
error: expected one of `:`, `@`, or `|`, found `S`
--> $DIR/inverted-parameters.rs:27:23
help: move the constraint after the generic argument
|
LL | pub fn test<W, I: Trait<W, Item = ()> >() {}
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to previous error
help: try surrounding the expression in parentheses
|
LL | (vec![1, 2, 3] as Vec<i32>)[0];
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:12:5
help: try surrounding the expression in parentheses
|
LL | (vec![1, 2, 3]: Vec<i32>)[0];
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:17:5
help: try surrounding the expression in parentheses
|
LL | ((&[0]) as &[i32])[0];
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:19:5
help: try surrounding the expression in parentheses
|
LL | ((&[0i32]): &[i32; 1])[0];
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:39:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32: i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:41:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32: i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:43:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32 as i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:45:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32 as i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:47:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32: i32 as u32 as i32).count_ones();
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:49:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32).count_ones(): u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:51:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32).count_ones(): u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:53:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32).count_ones() as u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:55:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0 as i32).count_ones() as u32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:57:13
help: try surrounding the expression in parentheses
|
LL | let _ = (0i32: i32: i32).count_ones() as u32 as i32;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:62:13
|
help: try surrounding the expression in parentheses
|
-LL | let _ = (0
-LL | as i32)
+LL ~ let _ = (0
+LL ~ as i32)
|
error: casts cannot be followed by indexing
help: try surrounding the expression in parentheses
|
LL | let x: i32 = (&vec![1, 2, 3] as &Vec<i32>)[0];
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:75:5
help: try surrounding the expression in parentheses
|
LL | (0 as i32).max(0);
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:77:5
help: try surrounding the expression in parentheses
|
LL | (0: i32).max(0);
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:92:8
help: try surrounding the expression in parentheses
|
LL | if (5u64 as i32).max(0) == 0 {
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:95:8
help: try surrounding the expression in parentheses
|
LL | if (5u64: u64).max(0) == 0 {
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:102:9
help: try surrounding the expression in parentheses
|
LL | (5u64 as u32).max(0) == 0
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:106:9
help: try surrounding the expression in parentheses
|
LL | (5u64: u64).max(0) == 0
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:111:24
help: try surrounding the expression in parentheses
|
LL | static bar: &[i32] = &((&[1,2,3] as &[i32])[0..1]);
- | ^ ^
+ | + +
error: casts cannot be followed by indexing
--> $DIR/issue-35813-postfix-after-cast.rs:114:25
help: try surrounding the expression in parentheses
|
LL | static bar2: &[i32] = &((&[1i32,2,3]: &[i32; 3])[0..1]);
- | ^ ^
+ | + +
error: casts cannot be followed by ?
--> $DIR/issue-35813-postfix-after-cast.rs:119:5
help: try surrounding the expression in parentheses
|
LL | (Err(0u64) as Result<u64,u64>)?;
- | ^ ^
+ | + +
error: casts cannot be followed by ?
--> $DIR/issue-35813-postfix-after-cast.rs:121:5
help: try surrounding the expression in parentheses
|
LL | (Err(0u64): Result<u64,u64>)?;
- | ^ ^
+ | + +
error: casts cannot be followed by a function call
--> $DIR/issue-35813-postfix-after-cast.rs:145:5
help: try surrounding the expression in parentheses
|
LL | (drop as fn(u8))(0);
- | ^ ^
+ | + +
error: casts cannot be followed by a function call
--> $DIR/issue-35813-postfix-after-cast.rs:147:5
help: try surrounding the expression in parentheses
|
LL | (drop_ptr: fn(u8))(0);
- | ^ ^
+ | + +
error: casts cannot be followed by `.await`
--> $DIR/issue-35813-postfix-after-cast.rs:152:5
help: try surrounding the expression in parentheses
|
LL | (Box::pin(noop()) as Pin<Box<dyn Future<Output = ()>>>).await;
- | ^ ^
+ | + +
error: casts cannot be followed by `.await`
--> $DIR/issue-35813-postfix-after-cast.rs:155:5
help: try surrounding the expression in parentheses
|
LL | (Box::pin(noop()): Pin<Box<_>>).await;
- | ^ ^
+ | + +
error: casts cannot be followed by a field access
--> $DIR/issue-35813-postfix-after-cast.rs:167:5
help: try surrounding the expression in parentheses
|
LL | (Foo::default() as Foo).bar;
- | ^ ^
+ | + +
error: casts cannot be followed by a field access
--> $DIR/issue-35813-postfix-after-cast.rs:169:5
help: try surrounding the expression in parentheses
|
LL | (Foo::default(): Foo).bar;
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:84:9
help: try surrounding the expression in parentheses
|
LL | (if true { 33 } else { 44 } as i32).max(0),
- | ^ ^
+ | + +
error: casts cannot be followed by a method call
--> $DIR/issue-35813-postfix-after-cast.rs:86:9
help: try surrounding the expression in parentheses
|
LL | (if true { 33 } else { 44 }: i32).max(0)
- | ^ ^
+ | + +
error[E0214]: parenthesized type parameters may only be used with a `Fn` trait
--> $DIR/issue-35813-postfix-after-cast.rs:131:13
help: you can escape reserved keywords to use them as identifiers
|
LL | foo!(r#true);
- | ^^^^^^
+ | ~~~~~~
error: expected type, found keyword `true`
--> $DIR/issue-44406.rs:8:10
help: you can escape reserved keywords to use them as identifiers
|
LL | m::r#for();
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: change the delimiters to curly braces
|
LL | y! { /* items */ }
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: add a semicolon
|
LL | Ϥ,;
- | ^
+ | +
error: cannot find macro `y` in this scope
--> $DIR/issue-62524.rs:5:1
|
help: try placing this code inside a block
|
-LL | fn foo(u: u8) { if u8 { macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
-LL | }
+LL ~ fn foo(u: u8) { if u8 { macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
+LL + }
|
error: aborting due to 6 previous errors
help: add `fn` here to parse `g` as a public function
|
LL | pub fn g() -> is
- | ^^
+ | ++
error: expected item, found `;`
--> $DIR/issue-62895.rs:10:9
|
help: surround the struct literal with parentheses
|
-LL | fn p() { match (s { v, E { [) {) }
+LL ~ fn p() { match (s { v, E { [) {) }
LL |
-LL | )
+LL ~ )
|
error: expected one of `.`, `?`, `{`, or an operator, found `}`
help: if you meant to write a byte string literal, use double quotes
|
LL | let _foo = b"hello\0";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: character literal may only contain one codepoint
--> $DIR/issue-64732.rs:6:16
help: if you meant to write a `str` literal, use double quotes
|
LL | let _bar = "hello";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
help: write `let` instead of `auto` to introduce a new variable
|
LL | let n = 0;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:4:5
help: write `let` instead of `auto` to introduce a new variable
|
LL | let m;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:8:5
help: write `let` instead of `var` to introduce a new variable
|
LL | let n = 0;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:10:5
help: write `let` instead of `var` to introduce a new variable
|
LL | let m;
- | ^^^
+ | ~~~
error: invalid variable declaration
--> $DIR/issue-65257-invalid-var-decl-recovery.rs:14:5
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0224]: at least one trait is required for an object type
--> $DIR/issue-68890-2.rs:3:14
help: if you meant to bind the contents of the rest of the array pattern into `ts`, use `@`
|
LL | [h, ref ts @ ..] => foo(c, n - h) + foo(ts, n),
- | ^
+ | +
error: aborting due to previous error
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-73568-lifetime-after-mut.rs:19:23
| ^^ help: use `dyn`: `dyn 'a`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0224]: at least one trait is required for an object type
--> $DIR/issue-73568-lifetime-after-mut.rs:14:18
help: you can escape reserved keywords to use them as identifiers
|
LL | r#impl
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#abstract = ();
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#as = "foo";
- | ^^^^
+ | ~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#break = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#const = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#continue = "foo";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#else = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#enum = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#final = ();
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#fn = "foo";
- | ^^^^
+ | ~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#for = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#if = "foo";
- | ^^^^
+ | ~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#impl = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#let = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#loop = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#match = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#mod = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#move = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#override = ();
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#pub = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#return = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#static = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#struct = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#trait = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#try = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#type = "foo";
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#typeof = ();
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#unsafe = "foo";
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#use = "foo";
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#where = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#while = "foo";
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#break {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: if you meant to write a `str` literal, use double quotes
|
LL | "nope"
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: if you meant to write a `str` literal, use double quotes
|
LL | static c: char = "●●";
- | ^^^^
+ | ~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-3.rs:5:20
help: if you meant to write a `str` literal, use double quotes
|
LL | let ch: &str = "●●";
- | ^^^^
+ | ~~~~
error: aborting due to 2 previous errors
help: if you meant to write a `str` literal, use double quotes
|
LL | static c: char = "\x10\x10";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-5.rs:5:20
help: if you meant to write a `str` literal, use double quotes
|
LL | let ch: &str = "\x10\x10";
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to 2 previous errors
help: if you meant to write a `str` literal, use double quotes
|
LL | let x: &str = "ab";
- | ^^^^
+ | ~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-6.rs:4:19
help: if you meant to write a `str` literal, use double quotes
|
LL | let y: char = "cd";
- | ^^^^
+ | ~~~~
error: character literal may only contain one codepoint
--> $DIR/lex-bad-char-literals-6.rs:6:13
help: if you meant to write a `str` literal, use double quotes
|
LL | let z = "ef";
- | ^^^^
+ | ~~~~
error[E0277]: can't compare `&str` with `char`
--> $DIR/lex-bad-char-literals-6.rs:9:10
help: if this is a `self` type, give it a parameter name
|
LL | fn test(self: &str) {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn test(str: &TypeName) {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn test(_: &str) {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 2 previous errors
help: wrap the expression in parentheses
|
LL | loop { break ('label: loop { break 'label 42; }); }
- | ^ ^
+ | + +
error: parentheses are required around this expression to avoid confusion with a labeled break expression
--> $DIR/lifetime_starts_expressions.rs:33:15
|
help: wrap the expression in parentheses
|
-LL | break ('inner_loop: loop {
+LL ~ break ('inner_loop: loop {
LL |
LL |
LL | break 'inner_loop 1;
-LL | });
+LL ~ });
|
warning: this labeled break expression is easy to confuse with an unlabeled break with a labeled value expression
help: wrap this expression in parentheses
|
LL | (loop { break 42; });
- | ^ ^
+ | + +
error: aborting due to 2 previous errors; 1 warning emitted
help: you can escape reserved keywords to use them as identifiers
|
LL | fn r#macro() {
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0224]: at least one trait is required for an object type
--> $DIR/trait-object-macro-matcher.rs:11:8
help: change the delimiters to curly braces
|
LL | macro_rules! foo{}
- | ^^
+ | ~~
help: add a semicolon
|
LL | macro_rules! foo();
- | ^
+ | +
error: macros that expand to items must be delimited with braces or followed by a semicolon
--> $DIR/macros-no-semicolon-items.rs:8:5
|
help: change the delimiters to curly braces
|
-LL | bar!{
+LL ~ bar!{
LL | blah
LL | blah
LL | blah
-LL | }
+LL + }
|
help: add a semicolon
|
LL | );
- | ^
+ | +
error: unexpected end of macro invocation
--> $DIR/macros-no-semicolon-items.rs:1:1
|
help: surround the statements with a body
|
-LL | { 7;
-LL | 8; }
+LL ~ { 7;
+LL ~ 8; }
|
error: `match` arm body without braces
|
help: surround the statements with a body
|
-LL | { 11;
-LL | 12; }
+LL ~ { 11;
+LL ~ 12; }
|
error: `match` arm body without braces
|
help: surround the statements with a body
|
-LL | { 14;
-LL | 15; }
+LL ~ { 14;
+LL ~ 15; }
|
error: expected one of `,`, `.`, `?`, `}`, or an operator, found reserved identifier `_`
|
help: surround the statements with a body
|
-LL | { 20;
-LL | 21 }
+LL ~ { 20;
+LL ~ 21 }
|
error: `match` arm body without braces
|
help: surround the statements with a body
|
-LL | { 24;
-LL | 25 }
+LL ~ { 24;
+LL ~ 25 }
|
error: `match` arm body without braces
|
help: surround the statements with a body
|
-LL | { 27;
-LL | 28 }
+LL ~ { 27;
+LL ~ 28 }
|
error: expected one of `,`, `.`, `?`, `}`, or an operator, found `;`
|
help: parentheses are required to parse this as an expression
|
-LL | 0 => ({
+LL ~ 0 => ({
LL | 0
-LL | }) + 5
+LL ~ }) + 5
|
error: aborting due to previous error
help: change the delimiters to curly braces
|
LL | macro_rules! abc { /* items */ }
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: add a semicolon
|
LL | macro_rules! abc(ؼ;
- | ^
+ | +
error: unexpected end of macro invocation
--> $DIR/mbe_missing_right_paren.rs:3:19
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut mut r#yield(become, await) = r#yield(0, 0);
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found reserved keyword `become`
--> $DIR/mut-patterns.rs:28:23
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut mut yield(r#become, await) = r#yield(0, 0);
- | ^^^^^^^^
+ | ~~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/mut-patterns.rs:28:31
help: you can escape reserved keywords to use them as identifiers
|
LL | let mut mut yield(become, r#await) = r#yield(0, 0);
- | ^^^^^^^
+ | ~~~~~~~
error: `mut` must be attached to each individual binding
--> $DIR/mut-patterns.rs:28:9
help: terminate the unicode escape
|
LL | let s = "\u{2603}";
- | ^
+ | +
error: aborting due to previous error
help: remove the qualifiers
|
LL | fn foo();
- | ^^
+ | ~~
error: functions in `extern` blocks cannot have qualifiers
--> $DIR/no-const-fn-in-extern-block.rs:4:21
help: remove the qualifiers
|
LL | fn bar();
- | ^^
+ | ~~
error: aborting due to 2 previous errors
help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: x) {
- | ^^^^^^^
+ | ~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo(x: TypeName) {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(_: x) {
- | ^^^^
+ | ~~~~
error: aborting due to previous error
help: if this is a `self` type, give it a parameter name
|
LL | fn a(self: B<) {}
- | ^^^^^^^
+ | ~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn a(_: B<) {}
- | ^^^^
+ | ~~~~
error: aborting due to previous error
help: use `..` for an exclusive range
|
LL | return ..1;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | return ..=1;
- | ^^^
+ | ~~~
error: unexpected token: `...`
--> $DIR/range_inclusive_dotdotdot.rs:12:13
help: use `..` for an exclusive range
|
LL | let x = ..0;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | let x = ..=0;
- | ^^^
+ | ~~~
error: unexpected token: `...`
--> $DIR/range_inclusive_dotdotdot.rs:16:14
help: use `..` for an exclusive range
|
LL | let x = 5..5;
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | let x = 5..=5;
- | ^^^
+ | ~~~
error: unexpected token: `...`
--> $DIR/range_inclusive_dotdotdot.rs:20:15
help: use `..` for an exclusive range
|
LL | for _ in 0..1 {}
- | ^^
+ | ~~
help: or `..=` for an inclusive range
|
LL | for _ in 0..=1 {}
- | ^^^
+ | ~~~
error: aborting due to 4 previous errors
help: to constrain the associated type, add a type after `=`
|
LL | bar::<Item = TheType>();
- | ^^^^^^^
+ | +++++++
help: remove the `=` if `Item` is a type
|
-LL | bar::<Item >();
- | --
+LL - bar::<Item = >();
+LL + bar::<Item >();
+ |
error: aborting due to previous error
help: use the tuple variant pattern syntax instead
|
LL | Enum::Bar(a, b) => {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 3 previous errors
help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
|
LL | println!("");
- | ^
+ | ~
error[E0308]: mismatched types
--> $DIR/recover-from-homoglyph.rs:3:20
LL | #![deny(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:45:13
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:48:13
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:51:13
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:54:16
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:57:13
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:60:14
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:64:13
| ^^^ help: use `..=` for an inclusive range
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: `...` range patterns are deprecated
--> $DIR/recover-range-pats.rs:138:20
| ------------ in this macro invocation
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0029]: only `char` and numeric types are allowed in range patterns
help: split the comparison into two
|
LL | false == false && false == false;
- | ^^^^^^^^
+ | ++++++++
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:9:11
help: parenthesize the comparison
|
LL | false == (0 < 2);
- | ^ ^
+ | + +
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:13:6
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | f::<X>();
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:17:6
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | f::<Result<Option<X>, Option<Option<X>>>(1, 2);
- | ^^
+ | ++
error: comparison operators cannot be chained
--> $DIR/require-parens-for-chained-comparison.rs:22:21
|
help: surround the struct literal with parentheses
|
-LL | for x in (Foo {
+LL ~ for x in (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error[E0277]: `bool` is not an iterator
|
help: surround the struct literal with parentheses
|
-LL | if (Foo {
+LL ~ if (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error: aborting due to previous error
|
help: surround the struct literal with parentheses
|
-LL | match (Foo {
+LL ~ match (Foo {
LL | x: 3
-LL | }) {
+LL ~ }) {
|
error: aborting due to previous error
|
help: surround the struct literal with parentheses
|
-LL | while (Foo {
+LL ~ while (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error: aborting due to previous error
|
help: surround the struct literal with parentheses
|
-LL | while || (Foo {
+LL ~ while || (Foo {
LL | x: 3
-LL | }).hi() {
+LL ~ }).hi() {
|
error[E0308]: mismatched types
help: surround the struct literal with parentheses
|
LL | if x == (E::I { field1: true, field2: 42 }) {}
- | ^ ^
+ | + +
error: struct literals are not allowed here
--> $DIR/struct-literal-variant-in-if.rs:15:13
help: surround the struct literal with parentheses
|
LL | if x == (E::V { field: false }) {}
- | ^ ^
+ | + +
error: struct literals are not allowed here
--> $DIR/struct-literal-variant-in-if.rs:17:13
help: surround the struct literal with parentheses
|
LL | if x == (E::J { field: -42 }) {}
- | ^ ^
+ | + +
error: struct literals are not allowed here
--> $DIR/struct-literal-variant-in-if.rs:19:13
help: surround the struct literal with parentheses
|
LL | if x == (E::K { field: "" }) {}
- | ^ ^
+ | + +
error[E0423]: expected value, found struct variant `E::V`
--> $DIR/struct-literal-variant-in-if.rs:10:13
help: surround the struct literal with parentheses
|
LL | if x == (E::V { field }) {}
- | ^ ^
+ | + +
error[E0308]: mismatched types
--> $DIR/struct-literal-variant-in-if.rs:10:20
|
help: remove the parentheses
|
-LL | fn foo2(_: &dyn Drop + AsRef<str>) {}
- | -- --
+LL - fn foo2(_: &dyn (Drop + AsRef<str>)) {}
+LL + fn foo2(_: &dyn Drop + AsRef<str>) {}
+ |
error: expected parameter name, found `{`
--> $DIR/trait-object-delimiters.rs:8:17
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/trait-object-trait-parens.rs:13:16
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn ?Sized + (for<'a> Trait<'a>) + (Obj)`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
warning: trait objects without an explicit `dyn` are deprecated
--> $DIR/trait-object-trait-parens.rs:18:16
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn for<'a> Trait<'a> + (Obj) + (?Sized)`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/trait-object-trait-parens.rs:8:35
help: Unicode character ';' (Greek Question Mark) looks like ';' (Semicolon), but it is not
|
LL | let y = 0;
- | ^
+ | ~
error: aborting due to previous error
help: Unicode characters '“' (Left Double Quotation Mark) and '”' (Right Double Quotation Mark) look like '"' (Quotation Mark), but are not
|
LL | println!("hello world");
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: unknown start of token: \u{201d}
--> $DIR/unicode-quote-chars.rs:2:26
help: Unicode character '”' (Right Double Quotation Mark) looks like '"' (Quotation Mark), but it is not
|
LL | println!(“hello world");
- | ^
+ | ~
error: expected `,`, found `world`
--> $DIR/unicode-quote-chars.rs:2:21
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn foo<T: PartialEq>(a: &T, b: T) where &T: PartialEq<T> {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
help: borrow this field in the pattern to avoid moving `x.0`
|
LL | Some(ref _y @ ref _z) => {}
- | ^^^
+ | +++
error[E0382]: borrow of moved value
--> $DIR/bind-by-move-neither-can-live-while-the-other-survives-1.rs:26:14
help: borrow this field in the pattern to avoid moving `x.0`
|
LL | Some(ref mut _y @ ref _z) => {}
- | ^^^
+ | +++
error: aborting due to 6 previous errors
help: borrow this field in the pattern to avoid moving the value
|
LL | ref a @ Some((ref b @ ref mut c, ref d @ e)) => {}
- | ^^^
+ | +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:38
help: borrow this field in the pattern to avoid moving the value
|
LL | ref a @ Some((ref b @ mut c, ref d @ ref e)) => {}
- | ^^^
+ | +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
help: use `_` to explicitly ignore each field
|
LL | let P(_) = U {};
- | ^
+ | +
help: use `..` to ignore all fields
|
LL | let P(..) = U {};
- | ^^
+ | ++
error: aborting due to 2 previous errors
help: if you don't need to use the contents of x, discard the tuple's remaining fields
|
LL | E::A(..) => {
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-74539.rs:8:18
help: use `_` to explicitly ignore each field
|
LL | E::A(x @ .., _) => {
- | ^^^
+ | +++
error: aborting due to 3 previous errors
help: if you don't need to use the contents of foo, discard the tuple's remaining fields
|
LL | let (..,) = (0, 0);
- | ^^
+ | ~~
error: `..` patterns are not allowed here
--> $DIR/issue-74702.rs:2:16
help: use `_` to explicitly ignore each field
|
LL | S(x, _) => {}
- | ^^^
+ | +++
error[E0023]: this pattern has 1 field, but the corresponding tuple struct has 2 fields
--> $DIR/pat-tuple-underfield.rs:14:9
help: use `_` to explicitly ignore each field
|
LL | S(_, _) => {}
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | S(..) => {}
- | ^^
+ | ~~
error[E0023]: this pattern has 0 fields, but the corresponding tuple struct has 2 fields
--> $DIR/pat-tuple-underfield.rs:20:9
help: use `_` to explicitly ignore each field
|
LL | S(_, _) => {}
- | ^^^^
+ | ++++
help: use `..` to ignore all fields
|
LL | S(..) => {}
- | ^^
+ | ++
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
--> $DIR/pat-tuple-underfield.rs:27:9
help: use `_` to explicitly ignore each field
|
LL | E::S(x, _) => {}
- | ^^^
+ | +++
error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
--> $DIR/pat-tuple-underfield.rs:32:9
help: use `_` to explicitly ignore each field
|
LL | E::S(_, _) => {}
- | ^^^
+ | +++
help: use `..` to ignore all fields
|
LL | E::S(..) => {}
- | ^^
+ | ~~
error[E0023]: this pattern has 0 fields, but the corresponding tuple variant has 2 fields
--> $DIR/pat-tuple-underfield.rs:38:9
help: use `_` to explicitly ignore each field
|
LL | E::S(_, _) => {}
- | ^^^^
+ | ++++
help: use `..` to ignore all fields
|
LL | E::S(..) => {}
- | ^^
+ | ++
error[E0023]: this pattern has 2 fields, but the corresponding tuple struct has 4 fields
--> $DIR/pat-tuple-underfield.rs:50:9
help: use `_` to explicitly ignore each field
|
LL | Point4( a , _ , _, _) => {}
- | ^^^^^^
+ | ++++++
help: use `..` to ignore the rest of the fields
|
LL | Point4( a, ..) => {}
- | ^^^^
+ | ~~~~
error: aborting due to 8 previous errors
help: use this syntax instead
|
LL | A::D => (),
- | ^^^^
+ | ~~~~
help: a tuple variant with a similar name exists
|
LL | A::B(_) => (),
- | ^
+ | ~
error[E0023]: this pattern has 3 fields, but the corresponding tuple variant has 2 fields
--> $DIR/pattern-error-continue.rs:17:9
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let E::A = e { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&B` and `&C` not covered
--> $DIR/non-exhaustive-defined-here.rs:40:11
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let E::A = e { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0004]: non-exhaustive patterns: `&&mut &B` and `&&mut &C` not covered
--> $DIR/non-exhaustive-defined-here.rs:48:11
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Opt::Some(ref _x) = e { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 8 previous errors
help: consider restricting type parameter `T`
|
LL | fn not_sync<T: std::marker::Sync>(x: Guard<T>) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/phantom-auto-trait.rs:26:12
help: consider restricting type parameter `T`
|
LL | fn nested_not_sync<T: std::marker::Sync>(x: Nested<Guard<T>>) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 2 previous errors
help: if you meant to write a comparison against a negative value, add a space in between `<` and `-`
|
LL | if x< -1 {
- | ^^^
+ | ~~~
error: aborting due to previous error
help: change the type of the numeric literal from `i32` to `u32`
|
LL | let_in(3u32, |i| { assert!(i == 3u32); });
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/pptypedef.rs:8:37
help: change the type of the numeric literal from `u32` to `i32`
|
LL | let_in(3i32, |i| { assert!(i == 3i32); });
- | ^^^^
+ | ~~~~
error: aborting due to 2 previous errors
help: a unit struct with a similar name exists
|
LL | Baz();
- | ^^^
+ | ~~~
help: consider importing this function instead
|
LL | use foo2::Bar;
help: a unit struct with a similar name exists
|
LL | Baz();
- | ^^^
+ | ~~~
help: consider importing this function
|
LL | use foo2::Bar;
help: a struct with a similar name exists
|
LL | let _x: Box<Baz>;
- | ^^^
+ | ~~~
help: consider importing this trait
|
LL | use foo1::Bar;
help: a unit struct with a similar name exists
|
LL | Baz();
- | ^^^
+ | ~~~
help: consider importing this function instead
|
LL | use foo2::Bar;
help: use `=` if you meant to assign
|
LL | let _x = Bar();
- | ^
+ | ~
help: consider importing this trait instead
|
LL | use foo1::Bar;
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | pub type Alias<T> = T;
- | --
+LL - pub type Alias<T: PrivTr> = T;
+LL + pub type Alias<T> = T;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/private-in-public-warn.rs:75:29
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | pub type Alias<T> = T;
- | --
+LL - pub type Alias<T> where T: PrivTr = T;
+LL + pub type Alias<T> = T;
+ |
error: aborting due to 36 previous errors; 2 warnings emitted
|
help: consider introducing a named lifetime parameter
|
-LL | struct A<'a> {
-LL | a: &'a u64
+LL ~ struct A<'a> {
+LL ~ a: &'a u64
|
error: aborting due to previous error
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | Some(x) => { return x.try_into().unwrap() },
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/span-preservation.rs:33:22
help: add `fn` here to parse `foo` as a public function
|
LL | pub fn foo(_s: usize) { bar() }
- | ^^
+ | ++
error: aborting due to previous error
help: add `fn` here to parse `bar` as a public method
|
LL | pub fn bar<'a>(&self, _s: &'a usize) -> bool { true }
- | ^^
+ | ++
error: aborting due to previous error
help: add `fn` here to parse `foo` as a public function
|
LL | pub fn foo<'a>(_s: &'a usize) -> bool { true }
- | ^^
+ | ++
error: aborting due to previous error
help: add `fn` here to parse `foo` as a public function
|
LL | pub fn foo(_s: usize) -> bool { true }
- | ^^
+ | ++
error: aborting due to previous error
help: add `struct` here to parse `S` as a public struct
|
LL | pub struct S<'a> {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: add `struct` here to parse `S` as a public struct
|
LL | pub struct S {
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: consider specifying the type argument in the method call
|
LL | l.iter().map(f).collect::<B>()?
- | ^^^^^
+ | +++++
error: aborting due to previous error
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 1 warning emitted
LL | #![warn(ellipsis_inclusive_range_patterns)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to previous error; 1 warning emitted
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `List` representable
|
LL | enum List<T> { Cons(T, Box<List<T>>), Nil }
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: borrow this field in the pattern to avoid moving `x.0.0`
|
LL | (Some(ref y), ()) => {},
- | ^^^
+ | +++
error: aborting due to 3 previous errors
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | WrapB::new().set(move |t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-big.rs:67:26
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | WrapB::new().set(move |t: bool| if t { x } else { y }) // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error: aborting due to 2 previous errors
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:9:17
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:24:17
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:24:17
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:55:17
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:66:17
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:90:21
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:104:21
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:132:21
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:147:21
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:175:21
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error[E0373]: closure may outlive the current function, but it borrows `y`, which is owned by the current function
--> $DIR/region-borrow-params-issue-29793-small.rs:189:21
help: to force the closure to take ownership of `y` (and any other referenced variables), use the `move` keyword
|
LL | let f = move |t: bool| if t { x } else { y }; // (separate errors for `x` vs `y`)
- | ^^^^
+ | ++++
error: aborting due to 20 previous errors
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn a(v: &[u8]) -> Box<dyn Foo + '_> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn a(v: &'static [u8]) -> Box<dyn Foo + 'static> {
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/region-object-lifetime-in-coercion.rs:13:14
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn b(v: &[u8]) -> Box<dyn Foo + '_> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn b(v: &'static [u8]) -> Box<dyn Foo + 'static> {
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error[E0759]: `v` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/region-object-lifetime-in-coercion.rs:19:14
help: to declare that the trait object captures data from argument `v`, you can add an explicit `'_` lifetime bound
|
LL | fn c(v: &[u8]) -> Box<dyn Foo + '_> {
- | ^^^^
+ | ++++
error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
--> $DIR/region-object-lifetime-in-coercion.rs:23:14
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn g<'a, T: 'static>(v: Box<dyn A<T> + 'a>) -> Box<dyn X + 'a> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn g<'a, T: 'static>(v: Box<(dyn A<T> + 'static)>) -> Box<dyn X + 'static> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `v`
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'a> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn i<'a, T, U>(v: Box<(dyn A<U> + 'static)>) -> Box<dyn X + 'static> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
|
help: consider introducing a named lifetime parameter
|
-LL | enum Foo<'a> {
-LL | Bar(&'a isize)
+LL ~ enum Foo<'a> {
+LL ~ Bar(&'a isize)
|
error: aborting due to previous error
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: &'a isize
+LL ~ struct Foo<'a> {
+LL ~ x: &'a isize
|
error: aborting due to previous error
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> Foo<'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn m4<'b>(&self, arg: &'b isize) { }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/regions-name-undeclared.rs:17:12
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> Foo<'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn m5<'b>(&'b self) { }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/regions-name-undeclared.rs:18:27
help: consider introducing lifetime `'b` here
|
LL | impl<'b, 'a> Foo<'a> {
- | ^^^
+ | +++
help: consider introducing lifetime `'b` here
|
LL | fn m6<'b>(&self, arg: Foo<'b>) { }
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/regions-name-undeclared.rs:26:22
help: consider introducing lifetime `'b` here
|
LL | fn fn_types<'b>(a: &'a isize,
- | ^^^^
+ | ++++
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | b: Box<dyn for<'a, 'b> FnOnce(&'a isize,
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/regions-name-undeclared.rs:46:36
help: consider introducing lifetime `'b` here
|
LL | fn fn_types<'b>(a: &'a isize,
- | ^^^^
+ | ++++
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | b: Box<dyn for<'a, 'b> FnOnce(&'a isize,
- | ^^^^
+ | ++++
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/regions-name-undeclared.rs:47:17
help: consider introducing lifetime `'a` here
|
LL | impl<'a> Bug {
- | ^^^^
+ | ++++
help: consider introducing lifetime `'a` here
|
LL | async fn buggy<'a>(&self) -> &'a str {
- | ^^^^
+ | ++++
error: aborting due to 12 previous errors
help: consider changing the trait object's explicit `'static` bound to the lifetime of argument `x`
|
LL | fn static_proc(x: &isize) -> Box<dyn FnMut() -> (isize) + '_> {
- | ^^
+ | ~~
help: alternatively, add an explicit `'static` bound to this reference
|
LL | fn static_proc(x: &'static isize) -> Box<dyn FnMut() -> (isize) + 'static> {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to previous error
help: use parentheses to call this function
|
LL | let _: unsafe extern "rust-intrinsic" fn(isize) -> usize = std::mem::transmute(...);
- | ^^^^^
+ | +++++
error[E0606]: casting `unsafe extern "rust-intrinsic" fn(_) -> _ {transmute::<_, _>}` as `unsafe extern "rust-intrinsic" fn(isize) -> usize` is invalid
--> $DIR/reify-intrinsic.rs:11:13
help: change the type of the numeric literal from `u8` to `usize`
|
LL | let f = [0; 4usize];
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 9 previous errors
help: you can escape reserved keywords to use them as identifiers
|
LL | let r#become = 0;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: you might have meant to call the associated function
|
LL | Self::default();
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: consider importing this function
|
LL | use std::default::default;
help: add a `self` receiver parameter to make the associated `fn` a method
|
LL | fn meow(&self) {
- | ^^^^^
+ | +++++
error[E0425]: cannot find function `grow_older` in this scope
--> $DIR/issue-2356.rs:72:5
help: use struct literal syntax instead
|
LL | handle: Handle {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: a local variable with a similar name exists
|
LL | handle: handle
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(_x: &K) {}
- | ^
+ | +
error: aborting due to previous error
help: a trait with a similar name exists
|
LL | impl I for isize {}
- | ^
+ | ~
error: aborting due to 2 previous errors
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`
--> $DIR/privacy-enum-ctor.rs:25:9
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`
--> $DIR/privacy-enum-ctor.rs:29:20
help: you might have meant to use the following enum variant
|
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
|
LL | let _: E = m::f;
- | ^
+ | ~
help: consider importing one of these items instead
|
LL | use std::f32::consts::E;
help: you might have meant to use the following enum variant
|
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
|
LL | use std::f32::consts::E;
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z;
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
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
--> $DIR/privacy-enum-ctor.rs:61:12
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z::Fn;
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z::Struct;
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
help: an enum with a similar name exists
|
LL | let _: E = m::n::Z::Unit {};
- | ^
+ | ~
help: consider importing this enum
|
LL | use m::Z;
help: use parentheses to instantiate this tuple variant
|
LL | let _: Z = Z::Fn(_);
- | ^^^
+ | +++
error[E0618]: expected function, found enum variant `Z::Unit`
--> $DIR/privacy-enum-ctor.rs:31:17
help: `Z::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | let _ = Z::Unit;
- | ^^^^^^^
+ | ~~~~~~~
error[E0308]: mismatched types
--> $DIR/privacy-enum-ctor.rs:43:16
help: use parentheses to instantiate this tuple variant
|
LL | let _: E = m::E::Fn(_);
- | ^^^
+ | +++
error[E0618]: expected function, found enum variant `m::E::Unit`
--> $DIR/privacy-enum-ctor.rs:47:16
help: `m::E::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | let _: E = m::E::Unit;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/privacy-enum-ctor.rs:51:16
help: use parentheses to instantiate this tuple variant
|
LL | let _: E = E::Fn(_);
- | ^^^
+ | +++
error[E0618]: expected function, found enum variant `E::Unit`
--> $DIR/privacy-enum-ctor.rs:55:16
help: `E::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | let _: E = E::Unit;
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to 23 previous errors
help: you can use `as` to change the binding name of the import
|
LL | use std::slice as other_std;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use std::mem::transmute as other_transmute;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | use std::slice::Iter as OtherIter;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: use `!` to invoke the macro
|
LL | assert_eq!(1, 1);
- | ^
+ | +
error: aborting due to previous error
help: a constant with a similar name exists
|
LL | a::I.J
- | ^
+ | ~
error[E0423]: expected value, found module `a`
--> $DIR/suggest-path-instead-of-mod-dot-item.rs:37:5
help: use the path separator to refer to an item
|
LL | a::b::f()
- | ^^^^^^^
+ | ~~~~~~~
help: a constant with a similar name exists
|
LL | a::I.f()
- | ^
+ | ~
error[E0423]: expected value, found module `a::b`
--> $DIR/suggest-path-instead-of-mod-dot-item.rs:50:5
help: consider using a semicolon here
|
LL | value.get_or_insert_with(func);
- | ^
+ | +
help: consider using a semicolon here
|
LL | };
- | ^
+ | +
help: you might have meant to return this value
|
LL | return value.get_or_insert_with(func);
- | ^^^^^^ ^
+ | ++++++ +
error: aborting due to previous error
help: consider using a semicolon here
|
LL | foo(4 as usize);
- | ^
+ | +
help: try adding a return type
|
LL | fn bar() -> S<usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to previous error
help: you might have meant to return this value
|
LL | return Err(42);
- | ^^^^^^ ^
+ | ++++++ +
error: aborting due to previous error
help: add `..` at the end of the field list to ignore all other fields
|
LL | let NormalStruct { first_field, second_field , .. } = ns;
- | ^^^^^^
+ | ~~~~~~
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:26:9
help: add `..` at the end of the field list to ignore all other fields
|
LL | let TupleStruct { 0: first_field, 1: second_field , .. } = ts;
- | ^^^^^^
+ | ~~~~~~
error[E0638]: `..` required with struct marked as non-exhaustive
--> $DIR/struct.rs:35:9
help: add `..` at the end of the field list to ignore all other fields
|
LL | let UnitStruct { .. } = us;
- | ^^^^
+ | ~~~~
error: aborting due to 9 previous errors
help: add `..` at the end of the field list to ignore all other fields
|
LL | NonExhaustiveVariants::Struct { field , .. } => ""
- | ^^^^^^
+ | ~~~~~~
error[E0638]: `..` required with variant marked as non-exhaustive
--> $DIR/variant.rs:30:12
help: add `..` at the end of the field list to ignore all other fields
|
LL | if let NonExhaustiveVariants::Struct { field , .. } = variant_struct {
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 8 previous errors
error[E0491]: in type `&'a Foo<'b>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-region-rev.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-region-rev.rs:17:20
|
LL | type Out = &'a Foo<'b>;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-region-rev.rs:16:10
error[E0491]: in type `&'a Foo<'b>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-region.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-region.rs:17:20
|
LL | type Out = &'a Foo<'b>;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-region.rs:16:10
error[E0491]: in type `&'a Foo<&'b i32>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-type-rev.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-type-rev.rs:17:20
|
LL | type Out = &'a Foo<&'b i32>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-type-rev.rs:16:10
error[E0491]: in type `&'a Foo<&'b i32>`, reference has a longer lifetime than the data it references
- --> $DIR/regions-outlives-nominal-type-type.rs:17:9
+ --> $DIR/regions-outlives-nominal-type-type.rs:17:20
|
LL | type Out = &'a Foo<&'b i32>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 16:10
--> $DIR/regions-outlives-nominal-type-type.rs:16:10
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/regions-struct-not-wf.rs:13:5
+ --> $DIR/regions-struct-not-wf.rs:13:16
|
LL | impl<'a, T> Trait<'a, T> for usize {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = &'a T;
- | ^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
+ | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/regions-struct-not-wf.rs:21:5
+ --> $DIR/regions-struct-not-wf.rs:21:16
|
LL | impl<'a, T> Trait<'a, T> for u32 {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = RefOk<'a, T>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
+ | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds...
|
note: ...that is required by this bound
--> $DIR/regions-struct-not-wf.rs:16:20
| ^^
error[E0491]: in type `&'a &'b T`, reference has a longer lifetime than the data it references
- --> $DIR/regions-struct-not-wf.rs:25:5
+ --> $DIR/regions-struct-not-wf.rs:25:16
|
LL | type Out = &'a &'b T;
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^
|
note: the pointer is valid for the lifetime `'a` as defined on the impl at 24:6
--> $DIR/regions-struct-not-wf.rs:24:6
help: enclose the `const` expression in braces
|
LL | { true && let 1 = 1 }
- | ^ ^
+ | + +
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:32:9
|
help: consider removing the borrow
|
-LL | if let 0 = 0 {}
- | --
+LL - if &let 0 = 0 {}
+LL + if let 0 = 0 {}
+ |
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:36:8
help: you might have meant to compare for equality
|
LL | if x == let 0 = 0 {}
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:59:8
|
help: consider removing the borrow
|
-LL | while let 0 = 0 {}
- | --
+LL - while &let 0 = 0 {}
+LL + while let 0 = 0 {}
+ |
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:100:11
help: you might have meant to compare for equality
|
LL | while x == let 0 = 0 {}
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:123:11
|
help: `if let` needs to be written without parentheses
|
-LL | if let 0 = 1 {}
- | -- --
+LL - if (let 0 = 1) {}
+LL + if let 0 = 1 {}
+ |
error: invalid parentheses around `let` expression in `if let`
--> $DIR/feature-gate.rs:18:8
|
help: `if let` needs to be written without parentheses
|
-LL | if let 0 = 1 {}
- | -- --
+LL - if (((let 0 = 1))) {}
+LL + if let 0 = 1 {}
+ |
error: `let` expressions are not supported here
--> $DIR/feature-gate.rs:22:16
|
help: `if let` needs to be written without parentheses
|
-LL | use_expr!(let 0 = 1);
- | -- --
+LL - use_expr!((let 0 = 1));
+LL + use_expr!(let 0 = 1);
+ |
error: `let` expressions are not supported here
--> $DIR/feature-gate.rs:127:16
help: if this is a `self` type, give it a parameter name
|
LL | trait Trait2015 { fn foo(#[allow(C)] self: i32); }
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | trait Trait2015 { fn foo(#[allow(C)] i32: TypeName); }
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | trait Trait2015 { fn foo(#[allow(C)] _: i32); }
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
|
help: you might have meant to write a const trait impl
|
-LL | impl const Foo for i32 {}
- |-- ^^^^^
+LL - const impl Foo for i32 {}
+LL + impl const Foo for i32 {}
+ |
error: expected identifier, found keyword `impl`
--> $DIR/const-impl-recovery.rs:9:7
|
help: you might have meant to write a const trait impl
|
-LL | impl<T: Foo> const Bar for T {}
- |-- ^^^^^
+LL - const impl<T: Foo> Bar for T {}
+LL + impl<T: Foo> const Bar for T {}
+ |
error: aborting due to 2 previous errors
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | static NON_ELIDABLE_FN: &for<'a> fn(&'a u8, &'a u8) -> &'a u8 =
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ~~~~~~ ~~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/rfc1623-2.rs:10:39
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | &(non_elidable as for<'a> fn(&'a u8, &'a u8) -> &'a u8);
- | ^^^^^^^ ^^^^^^ ^^^^^^ ^^^
+ | +++++++ ~~~~~~ ~~~~~~ ~~~
error: aborting due to 2 previous errors
help: you can escape reserved keywords to use them as identifiers
|
LL | type A1 = dyn::r#dyn;
- | ^^^^^
+ | ~~~~~
error: expected identifier, found `<`
--> $DIR/dyn-trait-compatibility.rs:5:14
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: remove these bounds
|
-LL | struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- --
+LL - struct TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> {
+LL + struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:18:61
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- --
+LL - struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b {
+LL + struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:23:53
|
help: remove these bounds
|
-LL | struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> {
+LL + struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:29:48
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
- | -- --
+LL - struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> {
+LL + struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:35:48
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> {
+LL + struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:41:46
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
- | -- --
+LL - struct TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b {
+LL + struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:47:67
|
help: remove these bounds
|
-LL | struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b {
+LL + struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:53:53
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug {
+LL + struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:59:53
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b {
+LL + struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:65:69
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug {
+LL + struct TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:71:69
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b {
+LL + struct TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:77:38
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeBee<'a, 'b, T> {
- | -- --
+LL - struct BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b> {
+LL + struct BeeOutlivesAyTeeBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:82:40
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeAyBee<'a, 'b, T> {
- | -- --
+LL - struct BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b> {
+LL + struct BeeOutlivesAyTeeAyBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:87:55
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- -- --
+LL - struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b> {
+LL + struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:92:68
|
help: remove these bounds
|
-LL | struct BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- -- --
+LL - struct BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where 'b: 'a, T: 'a + Debug + 'b {
+LL + struct BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:97:58
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- -- --
+LL - struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b> {
+LL + struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:104:18
|
help: remove these bounds
|
-LL | where U: Debug,
- | -- ----
+LL - where U: 'a + Debug + 'b, 'b: 'a
+LL + where U: Debug,
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:115:47
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
- | -- --
+LL - struct TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b>(&'a &'b T);
+LL + struct TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:118:72
|
help: remove these bounds
|
-LL | struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
- | -- --
+LL - struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: 'a + Debug + 'b;
+LL + struct TeeWhereOutlivesAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:121:53
|
help: remove these bounds
|
-LL | struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
- | -- --
+LL - struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b>(T, &'a &'b U);
+LL + struct TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:124:48
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug>(&'a T, &'b U);
- | -- --
+LL - struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug>(&'a T, &'b U);
+LL + struct TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug>(&'a T, &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:127:48
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug>(&'a T, &'b U);
- | -- --
+LL - struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b>(&'a T, &'b U);
+LL + struct TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug>(&'a T, &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:130:46
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U>(&'a T, &'b U) ;
- | -- --
+LL - struct TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U>(&'a T, &'b U) where U: 'b;
+LL + struct TeeOutlivesAyYooWhereBee<'a, 'b, T, U>(&'a T, &'b U) ;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:133:81
|
help: remove these bounds
|
-LL | struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U>(T, &'a &'b U) where U: Debug;
- | -- --
+LL - struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U>(T, &'a &'b U) where U: 'a + Debug + 'b;
+LL + struct TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U>(T, &'a &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:136:53
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U>(&'a T, &'b U) where U: 'b + Debug;
+LL + struct TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:139:53
|
help: remove these bounds
|
-LL | struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U>(&'a T, &'b U) where U: Debug + 'b;
+LL + struct TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:142:75
|
help: remove these bounds
|
-LL | struct TeeWhereAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeWhereAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where T: 'a, U: 'b + Debug;
+LL + struct TeeWhereAyYooWhereBeeIsDebug<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:145:75
|
help: remove these bounds
|
-LL | struct TeeWhereAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
- | -- --
+LL - struct TeeWhereAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where T: 'a, U: Debug + 'b;
+LL + struct TeeWhereAyYooWhereIsDebugBee<'a, 'b, T, U>(&'a T, &'b U) where U: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:148:38
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeBee<'a, 'b, T>(&'a &'b T);
- | -- --
+LL - struct BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b>(&'a &'b T);
+LL + struct BeeOutlivesAyTeeBee<'a, 'b, T>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:151:40
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeAyBee<'a, 'b, T>(&'a &'b T);
- | -- --
+LL - struct BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b>(&'a &'b T);
+LL + struct BeeOutlivesAyTeeAyBee<'a, 'b, T>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:154:55
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
- | -- -- --
+LL - struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b>(&'a &'b T);
+LL + struct BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug>(&'a &'b T);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:157:71
|
help: remove these bounds
|
-LL | struct BeeWhereAyTeeWhereAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
- | -- -- --
+LL - struct BeeWhereAyTeeWhereAyIsDebugBee<'a, 'b, T>(&'a &'b T) where 'b: 'a, T: 'a + Debug + 'b;
+LL + struct BeeWhereAyTeeWhereAyIsDebugBee<'a, 'b, T>(&'a &'b T) where T: Debug;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:160:58
|
help: remove these bounds
|
-LL | struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
- | -- -- --
+LL - struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b>(T, &'a &'b U);
+LL + struct BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug>(T, &'a &'b U);
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:164:18
|
help: remove these bounds
|
-LL | where U: Debug, ;
- | -- ----
+LL - where U: 'a + Debug + 'b, 'b: 'a;
+LL + where U: Debug, ;
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:171:45
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- --
+LL - enum TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> {
+LL + enum TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:176:59
|
help: remove these bounds
|
-LL | enum TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- --
+LL - enum TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b {
+LL + enum TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:181:51
|
help: remove these bounds
|
-LL | enum TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - enum TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> {
+LL + enum TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:187:46
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
- | -- --
+LL - enum TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> {
+LL + enum TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:193:46
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - enum TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> {
+LL + enum TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:199:44
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
- | -- --
+LL - enum TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b {
+LL + enum TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:205:65
|
help: remove these bounds
|
-LL | enum TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b {
+LL + enum TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:211:51
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug {
+LL + enum TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:217:51
|
help: remove these bounds
|
-LL | enum TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b {
+LL + enum TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:223:67
|
help: remove these bounds
|
-LL | enum TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug {
+LL + enum TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:229:67
|
help: remove these bounds
|
-LL | enum TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - enum TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b {
+LL + enum TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:235:36
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeBee<'a, 'b, T> {
- | -- --
+LL - enum BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b> {
+LL + enum BeeOutlivesAyTeeBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:240:38
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeAyBee<'a, 'b, T> {
- | -- --
+LL - enum BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b> {
+LL + enum BeeOutlivesAyTeeAyBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:246:53
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- -- --
+LL - enum BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b> {
+LL + enum BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:251:66
|
help: remove these bounds
|
-LL | enum BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- -- --
+LL - enum BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where 'b: 'a, T: 'a + Debug + 'b {
+LL + enum BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:256:56
|
help: remove these bounds
|
-LL | enum BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- -- --
+LL - enum BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b> {
+LL + enum BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:262:75
|
help: remove these bounds
|
-LL | enum BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
- | -- ----
+LL - enum BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b, 'b: 'a {
+LL + enum BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:271:46
|
help: remove these bounds
|
-LL | union TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- --
+LL - union TeeOutlivesAyIsDebugBee<'a, 'b, T: 'a + Debug + 'b> {
+LL + union TeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:276:60
|
help: remove these bounds
|
-LL | union TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- --
+LL - union TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: 'a + Debug + 'b {
+LL + union TeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:281:52
|
help: remove these bounds
|
-LL | union TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - union TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: 'a + Debug + 'b> {
+LL + union TeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:287:47
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
- | -- --
+LL - union TeeOutlivesAyYooBeeIsDebug<'a, 'b, T: 'a, U: 'b + Debug> {
+LL + union TeeOutlivesAyYooBeeIsDebug<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:293:47
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
- | -- --
+LL - union TeeOutlivesAyYooIsDebugBee<'a, 'b, T: 'a, U: Debug + 'b> {
+LL + union TeeOutlivesAyYooIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:299:45
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
- | -- --
+LL - union TeeOutlivesAyYooWhereBee<'a, 'b, T: 'a, U> where U: 'b {
+LL + union TeeOutlivesAyYooWhereBee<'a, 'b, T, U> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:305:66
|
help: remove these bounds
|
-LL | union TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b {
+LL + union TeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:311:52
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T: 'a, U> where U: 'b + Debug {
+LL + union TeeOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:317:52
|
help: remove these bounds
|
-LL | union TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T: 'a, U> where U: Debug + 'b {
+LL + union TeeOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:323:68
|
help: remove these bounds
|
-LL | union TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where T: 'a, U: 'b + Debug {
+LL + union TeeWhereOutlivesAyYooWhereBeeIsDebug<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:329:68
|
help: remove these bounds
|
-LL | union TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
- | -- --
+LL - union TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where T: 'a, U: Debug + 'b {
+LL + union TeeWhereOutlivesAyYooWhereIsDebugBee<'a, 'b, T, U> where U: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:335:37
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeBee<'a, 'b, T> {
- | -- --
+LL - union BeeOutlivesAyTeeBee<'a, 'b: 'a, T: 'b> {
+LL + union BeeOutlivesAyTeeBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:340:39
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeAyBee<'a, 'b, T> {
- | -- --
+LL - union BeeOutlivesAyTeeAyBee<'a, 'b: 'a, T: 'a + 'b> {
+LL + union BeeOutlivesAyTeeAyBee<'a, 'b, T> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:345:54
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
- | -- -- --
+LL - union BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b: 'a, T: 'a + Debug + 'b> {
+LL + union BeeOutlivesAyTeeOutlivesAyIsDebugBee<'a, 'b, T: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:350:67
|
help: remove these bounds
|
-LL | union BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
- | -- -- --
+LL - union BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where 'b: 'a, T: 'a + Debug + 'b {
+LL + union BeeWhereAyTeeWhereOutlivesAyIsDebugBee<'a, 'b, T> where T: Debug {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:355:57
|
help: remove these bounds
|
-LL | union BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
- | -- -- --
+LL - union BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b: 'a, T, U: 'a + Debug + 'b> {
+LL + union BeeOutlivesAyTeeYooOutlivesAyIsDebugBee<'a, 'b, T, U: Debug> {
+ |
error: outlives requirements can be inferred
--> $DIR/edition-lint-infer-outlives-multispan.rs:361:76
|
help: remove these bounds
|
-LL | union BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
- | -- ----
+LL - union BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: 'a + Debug + 'b, 'b: 'a {
+LL + union BeeWhereAyTeeYooWhereOutlivesAyIsDebugBee<'a, 'b, T, U> where U: Debug, {
+ |
error: aborting due to 68 previous errors
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-generic.rs:31:5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<i32, i32> as MyFromIter>::from_iter`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-generic.rs:34:5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Generic::<_, _> as MyFromIter>::from_iter`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 3 warnings emitted
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-imported.rs:40:22
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `crate::m::TryIntoU32::try_into(3u8)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision-imported.rs:53:22
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `super::m::TryIntoU32::try_into(3u8)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 3 warnings emitted
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Box::new(3u8).try_into().unwrap();
- | ^^^^^^^^^ ^
+ | +++++++++ +
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Pin::new(3u8).try_into().unwrap();
- | ^^^^^^^^^ ^
+ | +++++++++ +
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Arc::new(3u8).try_into().unwrap();
- | ^^^^^^^^^ ^
+ | +++++++++ +
help: consider wrapping the receiver expression with the appropriate type
|
LL | let _: u32 = Rc::new(3u8).try_into().unwrap();
- | ^^^^^^^^ ^
+ | ++++++++ +
error: aborting due to previous error
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:61:13
| ^^^^^^^^^^^^^ help: disambiguate the associated function: `<u32 as TryFromU8>::try_from`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `from_iter` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:66:13
| ^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<Vec<u8> as FromByteIterator>::from_iter`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:74:18
| ^^^^^^^^^^^^^ help: disambiguate the associated function: `<_ as TryFromU8>::try_from`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:79:18
| ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(*(&3u8))`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:84:18
| ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(&3.0)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait method `try_into` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:90:18
| ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(mut_ptr as *const _)`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: trait-associated function `try_from` will become ambiguous in Rust 2021
--> $DIR/future-prelude-collision.rs:95:13
| ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `<U32Alias as TryFromU8>::try_from`
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 8 warnings emitted
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 1 warning emitted
LL | #![warn(rust_2021_prelude_collisions)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #85684 <https://github.com/rust-lang/rust/issues/85684>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/prelude.html>
warning: 1 warning emitted
LL | #![warn(rust_2021_prefixes_incompatible_syntax)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m2!(z "hey");
- | --
+LL - m2!(z"hey");
+LL + m2!(z "hey");
+ |
warning: prefix `prefix` is unknown
--> $DIR/reserved-prefixes-migration.rs:19:9
| ^^^^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m2!(prefix "hey");
- | --
+LL - m2!(prefix"hey");
+LL + m2!(prefix "hey");
+ |
warning: prefix `hey` is unknown
--> $DIR/reserved-prefixes-migration.rs:22:9
| ^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m3!(hey #123);
- | --
+LL - m3!(hey#123);
+LL + m3!(hey #123);
+ |
warning: prefix `hey` is unknown
--> $DIR/reserved-prefixes-migration.rs:25:9
| ^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | m3!(hey #hey);
- | --
+LL - m3!(hey#hey);
+LL + m3!(hey #hey);
+ |
warning: prefix `kind` is unknown
--> $DIR/reserved-prefixes-migration.rs:35:14
| ^^^^ unknown prefix
|
= warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021!
- = note: for more information, see issue #84978 <https://github.com/rust-lang/rust/issues/84978>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/reserving-syntax.html>
help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021
|
-LL | #name = #kind #value
- | --
+LL - #name = #kind#value
+LL + #name = #kind #value
+ |
warning: 5 warnings emitted
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo3!(foo #bar);
- | --
+LL - demo3!(foo#bar);
+LL + demo3!(foo #bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:17:12
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo2!(foo "bar");
- | --
+LL - demo2!(foo"bar");
+LL + demo2!(foo "bar");
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:18:12
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo2!(foo 'b');
- | --
+LL - demo2!(foo'b');
+LL + demo2!(foo 'b');
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:20:12
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo2!(foo 'b);
- | --
+LL - demo2!(foo'b);
+LL + demo2!(foo 'b);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:21:12
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo3!(foo # bar);
- | --
+LL - demo3!(foo# bar);
+LL + demo3!(foo # bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:22:12
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo #! bar);
- | --
+LL - demo4!(foo#! bar);
+LL + demo4!(foo #! bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:23:12
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo ## bar);
- | --
+LL - demo4!(foo## bar);
+LL + demo4!(foo ## bar);
+ |
error: prefix `foo` is unknown
--> $DIR/reserved-prefixes.rs:25:12
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo #bar#);
- | --
+LL - demo4!(foo#bar#);
+LL + demo4!(foo #bar#);
+ |
error: prefix `bar` is unknown
--> $DIR/reserved-prefixes.rs:25:16
= note: prefixed identifiers and literals are reserved since Rust 2021
help: consider inserting whitespace here
|
-LL | demo4!(foo#bar #);
- | --
+LL - demo4!(foo#bar#);
+LL + demo4!(foo#bar #);
+ |
error: aborting due to 9 previous errors
// run-fail
// error-pattern: MemorySanitizer: use-of-uninitialized-value
// error-pattern: Uninitialized value was created by an allocation
-// error-pattern: in the stack frame of function 'random'
+// error-pattern: in the stack frame of function 'main'
//
// This test case intentionally limits the usage of the std,
// since it will be linked with an uninstrumented version of it.
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | async fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | async fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn f(self: Pin<&Self>) -> impl Clone + '_ { self }
- | ^^^^
+ | ++++
error: aborting due to previous error
help: consider wrapping the receiver expression with the appropriate type
|
LL | Box::new(A).foo();
- | ^^^^^^^^^ ^
+ | +++++++++ +
error: aborting due to previous error
help: consider wrapping the receiver expression with the appropriate type
|
LL | Box::new(A).foo()
- | ^^^^^^^^^ ^
+ | +++++++++ +
error: aborting due to previous error
help: use type parameters instead
|
LL | fn f<T>(self: T) {}
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/self-infer.rs:5:17
help: use type parameters instead
|
LL | fn g<T>(self: &T) {}
- | ^^^ ^
+ | +++ ~
error: aborting due to 2 previous errors
help: you can convert an `i64` to an `i32` and panic if the converted value doesn't fit
|
LL | let _: i32 = (22_i64 >> 1_i32).try_into().unwrap();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
| ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn a(x: &u32) {
- | -- --
+LL - fn a<'a>(x: &'a u32) {
+LL + fn a(x: &u32) {
+ |
error: lifetime parameter `'m` only used once
--> $DIR/one-use-in-fn-argument.rs:15:11
|
help: elide the single-use lifetime
|
-LL | fn center(_: Single<'_>) {}
- | -- ^^
+LL - fn center<'m>(_: Single<'m>) {}
+LL + fn center(_: Single<'_>) {}
+ |
error: lifetime parameter `'y` only used once
--> $DIR/one-use-in-fn-argument.rs:17:13
|
help: elide the single-use lifetime
|
-LL | fn left<'x>(foo: Double<'x, '_>) -> &'x u32 { foo.f }
- | -- ^^
+LL - fn left<'x, 'y>(foo: Double<'x, 'y>) -> &'x u32 { foo.f }
+LL + fn left<'x>(foo: Double<'x, '_>) -> &'x u32 { foo.f }
+ |
error: lifetime parameter `'x` only used once
--> $DIR/one-use-in-fn-argument.rs:19:10
|
help: elide the single-use lifetime
|
-LL | fn right<'y>(foo: Double<'_, 'y>) -> &'y u32 { foo.f }
- | -- ^^
+LL - fn right<'x, 'y>(foo: Double<'x, 'y>) -> &'y u32 { foo.f }
+LL + fn right<'y>(foo: Double<'_, 'y>) -> &'y u32 { foo.f }
+ |
error: aborting due to 4 previous errors
| ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn inherent_a(&self, data: &u32) {
- | -- --
+LL - fn inherent_a<'a>(&self, data: &'a u32) {
+LL + fn inherent_a(&self, data: &u32) {
+ |
error: lifetime parameter `'f` only used once
--> $DIR/one-use-in-inherent-method-argument.rs:11:6
| ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
|
-LL | fn next(&mut self) -> Option<Self::Item> {
- | ----
+LL - fn next<'g>(&'g mut self) -> Option<Self::Item> {
+LL + fn next(&mut self) -> Option<Self::Item> {
+ |
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Baz` representable
|
LL | struct Baz { q: Box<Option<Foo>> }
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `Foo` has infinite size
--> $DIR/sized-cycle-note.rs:11:1
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | struct Foo { q: Box<Option<Baz>> }
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
|
LL | tail: Box<Option<ListNode>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: try using a conversion method
|
LL | f = (box f).to_string();
- | ^ ^^^^^^^^^^^^^
+ | + +++++++++++++
error[E0308]: mismatched types
--> $DIR/coerce-suggestions.rs:21:9
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = *a.borrow() + 1; x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to previous error
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = y.borrow().clone(); x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error[E0597]: `y` does not live long enough
--> $DIR/issue-23338-locals-die-before-temps-of-body.rs:17:9
help: for example, you could save the expression's value in a new local variable `x` and then make `x` be the expression at the end of the block
|
LL | let x = y.borrow().clone(); x
- | ^^^^^^^ ^^^
+ | +++++++ +++
error: aborting due to 2 previous errors
help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: Option<i32>, String) {}
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(_: Option<i32>, String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/issue-34264.rs:1:27
help: if this is a parameter name, give it a type
|
LL | fn foo(Option<i32>, String: TypeName) {}
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(Option<i32>, _: String) {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/issue-34264.rs:3:9
help: if this is a `self` type, give it a parameter name
|
LL | fn bar(self: x, y: usize) {}
- | ^^^^^^^
+ | ~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn bar(x: TypeName, y: usize) {}
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar(_: x, y: usize) {}
- | ^^^^
+ | ~~~~
error[E0061]: this function takes 2 arguments but 3 arguments were supplied
--> $DIR/issue-34264.rs:7:5
help: disambiguate the associated function for candidate #1
|
LL | A::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> $DIR/issue-37767.rs:22:7
help: disambiguate the associated function for candidate #1
|
LL | C::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | D::foo(&a)
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0034]: multiple applicable items in scope
--> $DIR/issue-37767.rs:34:7
help: disambiguate the associated function for candidate #1
|
LL | E::foo(a)
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | F::foo(a)
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: aborting due to 3 previous errors
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let x = "Hello ".to_owned() + "World!";
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error[E0369]: cannot add `World` to `World`
--> $DIR/issue-39018.rs:8:26
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let x = "Hello ".to_owned() + &"World!".to_owned();
- | ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
error[E0369]: cannot add `&String` to `&String`
--> $DIR/issue-39018.rs:26:16
help: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = a + &b;
- | ^
+ | ~
error[E0369]: cannot add `String` to `&String`
--> $DIR/issue-39018.rs:27:16
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = a + &b;
- | ^ ^^
+ | ~ ~~
error[E0308]: mismatched types
--> $DIR/issue-39018.rs:29:17
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + &b;
- | ^^^^^^^^^^^^ ^^
+ | ~~~~~~~~~~~~ ~~
error[E0369]: cannot add `&String` to `&String`
--> $DIR/issue-39018.rs:31:15
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + &b;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&str` to `&String`
--> $DIR/issue-39018.rs:32:15
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&&str` to `&String`
--> $DIR/issue-39018.rs:33:15
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = e.to_owned() + &d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&&str` to `&&str`
--> $DIR/issue-39018.rs:34:16
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = c.to_owned() + &d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error[E0369]: cannot add `&str` to `&str`
--> $DIR/issue-39018.rs:37:15
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = c.to_owned() + d;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to 14 previous errors
help: disambiguate the associated function for candidate #1
|
LL | u.f8(42) + CtxtFn::f9(u, 342) + m.fff(42)
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | u.f8(42) + OtherTrait::f9(u, 342) + m.fff(42)
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #3
|
LL | u.f8(42) + UnusedTrait::f9(u, 342) + m.fff(42)
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0599]: no method named `fff` found for struct `Myisize` in the current scope
--> $DIR/issue-7575.rs:62:30
--> $DIR/issue-7575.rs:70:7
|
LL | t.is_str()
- | --^^^^^^--
- | | |
- | | this is an associated function, not a method
- | help: disambiguate the associated function for the candidate: `ManyImplTrait::is_str(t)`
+ | ^^^^^^ this is an associated function, not a method
|
= note: found the following associated functions; to be used as methods, functions must have a `self` parameter
note: the candidate is defined in the trait `ManyImplTrait`
LL | fn is_str() -> bool {
| ^^^^^^^^^^^^^^^^^^^
= help: items from traits can only be used if the type parameter is bounded by the trait
+help: disambiguate the associated function for the candidate
+ |
+LL | ManyImplTrait::is_str(t)
+ |
error: aborting due to 3 previous errors
help: Unicode character '˂' (Modifier Letter Left Arrowhead) looks like '<' (Less-Than Sign), but it is not
|
LL | fn x<-
- | ^
+ | ~
error: expected one of `#`, `>`, `const`, identifier, or lifetime, found `-`
--> $DIR/issue-81800.rs:1:6
help: expected the unit value `()`; create it with empty parentheses
|
LL | let _: Result<(), String> = Ok(());
- | ^^
+ | ++
error[E0061]: this function takes 2 arguments but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:12:5
help: expected the unit value `()`; create it with empty parentheses
|
LL | bar(());
- | ^^
+ | ++
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:15:7
help: expected the unit value `()`; create it with empty parentheses
|
LL | S.baz(());
- | ^^
+ | ++
error[E0061]: this function takes 1 argument but 0 arguments were supplied
--> $DIR/missing-unit-argument.rs:16:7
help: expected the unit value `()`; create it with empty parentheses
|
LL | S.generic::<()>(());
- | ^^
+ | ++
error: aborting due to 6 previous errors
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `ListNode` representable
|
LL | tail: Box<Option<ListNode>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | bar: Box<Bar<'a>>,
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `Bar` has infinite size
--> $DIR/recursive-type-field.rs:8:1
help: consider specifying the type argument in the method call
|
LL | let _ = (vec![1,2,3]).into_iter().sum::<S>() as f64;
- | ^^^^^
+ | +++++
error: aborting due to previous error
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | impl<B: 'static, T> X<B> for T where &'static B: PartialEq<B> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++
error: aborting due to previous error; 1 warning emitted
help: consider further restricting this bound
|
LL | impl<T: 'static + std::cmp::PartialEq> X for T {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error; 1 warning emitted
help: consider restricting type parameter `U`
|
LL | default impl<U: std::cmp::Eq> Foo<'static, U> for () {}
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error; 1 warning emitted
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> UncheckedCopy for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
error: unconstrained generic constant
- --> $DIR/issue-51892.rs:15:5
+ --> $DIR/issue-51892.rs:15:17
|
LL | type Type = [u8; std::mem::size_of::<<T as Trait>::Type>()];
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: try adding a `where` bound using this expression: `where [(); std::mem::size_of::<<T as Trait>::Type>()]:`
help: consider borrowing here
|
LL | let v = &s[..2];
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/str-array-assignment.rs:9:17
help: if you meant to write a `str` literal, use double quotes
|
LL | println!("●●");
- | ^^^^
+ | ~~~~
error: aborting due to previous error
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let c = a.to_owned() + b;
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to previous error
--- /dev/null
+// check-pass
+fn main() {
+ let s = "\
+
+ ";
+ //~^^^ WARNING multiple lines skipped by escaped newline
+ let s = "foo\
+ bar
+ ";
+ //~^^^ WARNING non-ASCII whitespace symbol '\u{a0}' is not skipped
+}
--- /dev/null
+warning: multiple lines skipped by escaped newline
+ --> $DIR/str-escape.rs:3:14
+ |
+LL | let s = "\
+ | ______________^
+LL | |
+LL | | ";
+ | |_____________^ skipping everything up to and including this point
+
+warning: non-ASCII whitespace symbol '\u{a0}' is not skipped
+ --> $DIR/str-escape.rs:7:17
+ |
+LL | let s = "foo\
+ | _________________^
+LL | | bar
+ | | ^ non-ASCII whitespace symbol '\u{a0}' is not skipped
+ | |___|
+ |
+
+warning: 2 warnings emitted
+
help: consider adding a leading `b`
|
LL | let x: &[u8] = b"foo";
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/str-lit-type-mismatch.rs:3:23
help: consider adding a leading `b`
|
LL | let y: &[u8; 4] = b"baaa";
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/str-lit-type-mismatch.rs:4:19
found reference `&'static [u8; 3]`
help: consider removing the leading `b`
|
-LL | let z: &str = "foo";
- | --
+LL - let z: &str = b"foo";
+LL + let z: &str = "foo";
+ |
error: aborting due to 3 previous errors
help: consider relaxing the implicit `Sized` restriction
|
LL | fn bot<T: ?Sized>() -> T { loop {} }
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/str-mut-idx.rs:4:5
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable
|
LL | y: Box<A<A<T>>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `Foo` representable
|
LL | x: Box<Foo<[T; 1]>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `A` representable
|
LL | y: Box<B<T>>,
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `B` has infinite size
--> $DIR/mutual-struct-recursion.rs:7:1
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `B` representable
|
LL | z: Box<A<T>>
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `C` has infinite size
--> $DIR/mutual-struct-recursion.rs:12:1
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `C` representable
|
LL | y: Box<Option<Option<D<T>>>>,
- | ^^^^ ^
+ | ++++ +
error[E0072]: recursive type `D` has infinite size
--> $DIR/mutual-struct-recursion.rs:18:1
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `D` representable
|
LL | z: Box<Option<Option<C<T>>>>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 4 previous errors
help: include the missing field in the pattern
|
LL | let Foo { present } = foo;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
help: if you don't care about this missing field, you can explicitly ignore it
|
LL | let Foo { .. } = foo;
- | ^^^^^^
+ | ~~~~~~
error[E0026]: struct `Foo` does not have a field named `absent`
--> $DIR/struct-field-cfg.rs:16:42
help: include the missing fields in the pattern
|
LL | let A { x, y, b, c } = self.d;
- | ^^^^^^^^
+ | ~~~~~~~~
help: if you don't care about these missing fields, you can explicitly ignore them
|
LL | let A { x, y, .. } = self.d;
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 3 previous errors
help: use the tuple variant pattern syntax instead
|
LL | E::S(_, _) => {}
- | ^^^^^^
+ | ~~~~~~
error[E0769]: tuple variant `S` written as struct variant
--> $DIR/struct-tuple-field-names.rs:13:9
help: use the tuple variant pattern syntax instead
|
LL | S(_, _) => {}
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:25:17
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:33:17
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:41:17
help: use parentheses to call this function
|
LL | let x: () = foo::<'static>();
- | ^^
+ | ++
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/substs-ppaux.rs:49:5
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:25:17
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u32>>::bar::<'static, char>();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:33:17
help: use parentheses to call this function
|
LL | let x: () = <i8 as Foo<'static, 'static, u8>>::baz();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/substs-ppaux.rs:41:17
help: use parentheses to call this function
|
LL | let x: () = foo::<'static>();
- | ^^
+ | ++
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/substs-ppaux.rs:49:5
help: consider further restricting `Self`
|
LL | fn func1() -> Struct1<Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct1<T: ?Sized>{
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:3:23
help: consider further restricting `Self`
|
LL | fn func2<'a>() -> Struct2<'a, Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct2<'a, T: ?Sized>{
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:4:19
help: consider further restricting `Self`
|
LL | fn func3() -> Struct3<Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:5:19
help: consider further restricting `Self`
|
LL | fn func4() -> Struct4<Self> where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | struct Struct4<T: ?Sized>{
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/adt-param-with-implicit-sized-bound.rs:25:9
| this could be changed to `T: ?Sized`...
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | struct Struct5<T>{
- | --
+LL - struct Struct5<T: ?Sized>{
+LL + struct Struct5<T>{
+ |
error: aborting due to 5 previous errors
help: consider calling `.as_ref()` to borrow the type's contents
|
LL | let _x: Option<Struct> = foo.as_ref().map(|s| bar(&s));
- | ^^^^^^^^^
+ | +++++++++
error: aborting due to previous error
help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`
|
LL | let y: Result<&usize, &usize> = x.as_ref();
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/as-ref.rs:19:36
help: use parentheses to call the function
|
LL | bar(foo());
- | ^^
+ | ++
error[E0277]: `[closure@$DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:11:25: 11:36]` is not a future
--> $DIR/async-fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:12:9
help: use parentheses to call the closure
|
LL | bar(async_closure());
- | ^^
+ | ++
error: aborting due to 2 previous errors
help: bind the struct field to a different name instead
|
LL | let Thing { foo: other_foo } = t;
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to previous error
help: the following trait defines an item `get_a`, perhaps you need to add another supertrait for it:
|
LL | trait UseString: std::fmt::Debug + GetString {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0599]: no method named `get_a` found for reference `&Self` in the current scope
--> $DIR/constrain-trait.rs:21:31
help: the following trait defines an item `get_a`, perhaps you need to add a supertrait for it:
|
LL | trait UseString2: GetString {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to 2 previous errors
help: consider removing the `&`
|
LL | (Either::One(_t), Either::Two(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider removing the `&`
|
LL | (Either::Two(_t), Either::One(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0507]: cannot move out of a shared reference
--> $DIR/duplicate-suggestions.rs:61:11
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the `&`
|
-LL | (Either::One(_t), Either::Two(_u))
-LL |
-LL |
-LL | | &(Either::Two(_t), Either::One(_u)) => (),
+LL ~ (Either::One(_t), Either::Two(_u))
+LL +
+LL +
+LL ~ | &(Either::Two(_t), Either::One(_u)) => (),
|
error[E0507]: cannot move out of a shared reference
help: consider removing the `&mut`
|
LL | (Either::One(_t), Either::Two(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: consider removing the `&mut`
|
LL | (Either::Two(_t), Either::One(_u)) => (),
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0507]: cannot move out of a mutable reference
--> $DIR/duplicate-suggestions.rs:113:11
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the `&mut`
|
-LL | (Either::One(_t), Either::Two(_u))
-LL |
-LL |
-LL | | &mut (Either::Two(_t), Either::One(_u)) => (),
+LL ~ (Either::One(_t), Either::Two(_u))
+LL +
+LL +
+LL ~ | &mut (Either::Two(_t), Either::One(_u)) => (),
|
error[E0507]: cannot move out of a mutable reference
|
help: consider removing the `&`
|
-LL | Either::One(_t)
-LL |
-LL |
-LL | | &Either::Two(_t) => (),
+LL ~ Either::One(_t)
+LL +
+LL +
+LL ~ | &Either::Two(_t) => (),
|
error[E0507]: cannot move out of `r.0` which is behind a shared reference
help: consider removing the `&mut`
|
LL | Either::One(_t) => (),
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: consider removing the `&mut`
|
LL | Either::Two(_t) => (),
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error[E0507]: cannot move out of `rm.0` which is behind a mutable reference
--> $DIR/simple.rs:228:11
|
help: consider removing the `&`
|
-LL | Either::One(_t)
-LL |
-LL |
-LL | | &Either::Two(_t) => (),
+LL ~ Either::One(_t)
+LL +
+LL +
+LL ~ | &Either::Two(_t) => (),
|
error[E0507]: cannot move out of a shared reference
|
help: consider removing the `&mut`
|
-LL | Either::One(_t)
-LL |
-LL |
-LL | | &mut Either::Two(_t) => (),
+LL ~ Either::One(_t)
+LL +
+LL +
+LL ~ | &mut Either::Two(_t) => (),
|
error[E0507]: cannot move out of a mutable reference
help: you need to pin and box this expression
|
LL | Box::pin(x)
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0308]: mismatched types
--> $DIR/expected-boxed-future-isnt-pinned.rs:18:5
help: store this in the heap by calling `Box::new`
|
LL | Pin::new(Box::new(x))
- | ^^^^^^^^^ ^
+ | +++++++++ +
error[E0277]: `dyn Future<Output = i32> + Send` cannot be unpinned
--> $DIR/expected-boxed-future-isnt-pinned.rs:22:5
found opaque type `impl Future`
help: you need to pin and box this expression
|
-LL | Box::pin(async {
+LL ~ Box::pin(async {
LL | 42
-LL | })
+LL ~ })
|
error: aborting due to 6 previous errors
help: you might have meant to use field `b` whose type is `B`
|
LL | if let B::Fst = a.b {};
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/field-access.rs:25:9
help: you might have meant to use field `b` whose type is `B`
|
LL | match a.b {
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/field-access.rs:26:9
help: you might have meant to use field `b` whose type is `B`
|
LL | match a.b {
- | ^^^
+ | ~~~
error[E0308]: mismatched types
--> $DIR/field-access.rs:32:9
help: you might have meant to use field `bar` whose type is `u32`
|
LL | match unsafe { foo.bar } {
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
help: use parentheses to call the function
|
LL | bar(foo());
- | ^^
+ | ++
error[E0277]: the trait bound `[closure@$DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:18:19: 18:23]: T` is not satisfied
--> $DIR/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs:19:9
help: use parentheses to call the closure
|
LL | bar(closure());
- | ^^
+ | ++
error: aborting due to 2 previous errors
help: consider introducing lifetime `'a` here
|
LL | struct S1<'a, F: Fn(&i32, &i32) -> &'a i32>(F);
- | ^^^
+ | +++
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | struct S1<F: for<'a> Fn(&i32, &i32) -> &'a i32>(F);
- | ^^^^^^^
+ | +++++++
error[E0106]: missing lifetime specifier
--> $DIR/fn-missing-lifetime-in-item.rs:2:32
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | struct S2<F: for<'a> Fn(&'a i32, &'a i32) -> &'a i32>(F);
- | ^^^^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | +++++++ ~~~~~~~ ~~~~~~~ ~~~
help: consider introducing a named lifetime parameter
|
LL | struct S2<'a, F: Fn(&'a i32, &'a i32) -> &'a i32>(F);
- | ^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | +++ ~~~~~~~ ~~~~~~~ ~~~
error[E0582]: binding for associated type `Output` references lifetime `'a`, which does not appear in the trait input types
--> $DIR/fn-missing-lifetime-in-item.rs:3:40
help: use struct literal syntax instead
|
LL | let _: E = E::B { a: val };
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: a tuple variant with a similar name exists
|
LL | let _: E = E::A;
- | ^
+ | ~
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:29:20
help: use parentheses to call this function
|
LL | let _: usize = foo(a, b);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:30:16
help: use parentheses to instantiate this tuple struct
|
LL | let _: S = S(_, _);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:31:20
help: use parentheses to call this function
|
LL | let _: usize = bar();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:32:16
help: use parentheses to instantiate this tuple struct
|
LL | let _: V = V();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:33:20
help: use parentheses to call this function
|
LL | let _: usize = T::baz(x, y);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:34:20
help: use parentheses to call this function
|
LL | let _: usize = T::bat(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:35:16
help: use parentheses to instantiate this tuple variant
|
LL | let _: E = E::A(_);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:37:20
help: use parentheses to call this function
|
LL | let _: usize = X::baz(x, y);
- | ^^^^^^
+ | ++++++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:38:20
help: use parentheses to call this function
|
LL | let _: usize = X::bat(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:39:20
help: use parentheses to call this function
|
LL | let _: usize = X::bax(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:40:20
help: use parentheses to call this function
|
LL | let _: usize = X::bach(x);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:41:20
help: use parentheses to call this function
|
LL | let _: usize = X::ban(_);
- | ^^^
+ | +++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:42:20
help: use parentheses to call this function
|
LL | let _: usize = X::bal(_);
- | ^^^
+ | +++
error[E0615]: attempted to take value of method `ban` on type `X`
--> $DIR/fn-or-tuple-struct-without-args.rs:43:22
help: use parentheses to call the method
|
LL | let _: usize = X.ban();
- | ^^
+ | ++
error[E0615]: attempted to take value of method `bal` on type `X`
--> $DIR/fn-or-tuple-struct-without-args.rs:44:22
help: use parentheses to call the method
|
LL | let _: usize = X.bal();
- | ^^
+ | ++
error[E0308]: mismatched types
--> $DIR/fn-or-tuple-struct-without-args.rs:46:20
help: use parentheses to call this closure
|
LL | let _: usize = closure();
- | ^^
+ | ++
error: aborting due to 17 previous errors
help: consider iterating over a slice of the `Vec<u32>`'s content
|
LL | for _ in &self.v {
- | ^
+ | +
error[E0507]: cannot move out of `self.h` which is behind a shared reference
--> $DIR/for-i-in-vec.rs:13:18
help: consider iterating over a slice of the `HashMap<i32, i32>`'s content
|
LL | for _ in &self.h {
- | ^
+ | +
error: aborting due to 2 previous errors
|
help: consider removing the borrow
|
-LL | let a: String = String::from("a");
- | --
+LL - let a: String = &String::from("a");
+LL + let a: String = String::from("a");
+ |
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:4:21
|
help: consider removing the borrow
|
-LL | let b: String = format!("b");
- | --
+LL - let b: String = &format!("b");
+LL + let b: String = format!("b");
+ |
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:6:21
|
help: consider removing the borrow
|
-LL | let c: String = format!("c");
- | --
+LL - let c: String = &mut format!("c");
+LL + let c: String = format!("c");
+ |
error[E0308]: mismatched types
--> $DIR/format-borrow.rs:8:21
|
help: consider removing the borrow
|
-LL | let d: String = format!("d"));
- | --
+LL - let d: String = &mut (format!("d"));
+LL + let d: String = format!("d"));
+ |
error: aborting due to 4 previous errors
help: you might have meant to use pattern matching
|
LL | if let Some(x) = foo {}
- | ^^^
+ | +++
error[E0658]: destructuring assignments are unstable
--> $DIR/if-let-typo.rs:4:16
help: you might have meant to use pattern matching
|
LL | if let 3 = foo {}
- | ^^^
+ | +++
error[E0070]: invalid left-hand side of assignment
--> $DIR/if-let-typo.rs:10:16
help: consider changing this borrow's mutability
|
LL | foo(&mut s);
- | ^^^^
+ | ~~~~
error[E0277]: the trait bound `S: Trait` is not satisfied
--> $DIR/imm-ref-trait-object-literal.rs:13:7
help: you can add a bound to the opaque type to make it last less than `'static` and match `'a`
|
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> + 'a {
- | ^^^^
+ | ++++
error[E0515]: cannot return value referencing function parameter `val`
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9
help: you can add a bound to the opaque type to make it last less than `'static` and match `'a`
|
LL | fn use_it<'a>(val: Box<dyn ObjectTrait<Assoc = i32>>) -> impl OtherTrait<'a> + 'a {
- | ^^^^
+ | ++++
error[E0515]: cannot return value referencing function parameter `val`
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound-needing-more-suggestions.rs:43:9
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for Box<dyn ObjectTrait<Assoc = i32> + '_> {
- | ^^^^
+ | ++++
error: aborting due to 4 previous errors
help: consider relaxing the implicit `'static` requirement
|
LL | impl<T> MyTrait<T> for dyn ObjectTrait<T> + '_ {
- | ^^^^
+ | ++++
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:69:13
help: consider relaxing the implicit `'static` requirement
|
LL | impl dyn ObjectTrait + '_ {
- | ^^^^
+ | ++++
error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:88:13
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for dyn ObjectTrait + '_ {}
- | ^^^^
+ | ++++
help: to declare that the `impl Trait` captures data from argument `val`, you can add an explicit `'a` lifetime bound
|
LL | fn use_it<'a>(val: &'a dyn ObjectTrait) -> impl OtherTrait<'a> + 'a {
- | ^^^^
+ | ++++
error[E0759]: `val` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:108:27
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for dyn ObjectTrait + '_ {}
- | ^^^^
+ | ++++
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:37:13
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for dyn ObjectTrait + '_ {
- | ^^^^
+ | ++++
error[E0772]: `val` has lifetime `'a` but calling `use_self` introduces an implicit `'static` lifetime requirement
--> $DIR/impl-on-dyn-trait-with-implicit-static-bound.rs:54:13
help: consider relaxing the implicit `'static` requirement
|
LL | impl MyTrait for Box<dyn ObjectTrait + '_> {
- | ^^^^
+ | ++++
error: aborting due to 6 previous errors
help: consider introducing a named lifetime parameter
|
LL | fn f<'a>(_: impl Iterator<Item = &'a ()>) {}
- | ^^^^ ^^
+ | ++++ ~~
error: aborting due to previous error
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn foo<I: Iterator>(constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:14:13
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn bar<T, I: Iterator>(t: T, constraints: I) where T: std::fmt::Debug, <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:22:13
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn baz<I: Iterator>(t: impl std::fmt::Debug, constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:30:13
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn bat<I, T: std::fmt::Debug, U: Iterator>(t: T, constraints: U, _: I) where <U as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++ ~ ++++++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator + std::fmt::Debug as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:37:13
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn bak<I: Iterator + std::fmt::Debug>(constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++ ~ ++++++++++++++++++++++++++++++++++
error[E0277]: `<impl Iterator as Iterator>::Item` doesn't implement `Debug`
--> $DIR/impl-trait-with-missing-bounds.rs:45:13
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | fn baw<I: Iterator>(constraints: I) where <I as Iterator>::Item: Debug {
- | ^^^^^^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~ ~ ++++++++++++++++++++++++++++++++++
error: aborting due to 6 previous errors
help: the following trait defines an item `hello`, perhaps you need to restrict type parameter `impl Foo` with it:
|
LL | fn test(foo: impl Foo + Bar) {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: aborting due to previous error
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it:
|
LL | fn call_method<T: Foo + std::fmt::Debug>(x: &T) {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0599]: no method named `method` found for type parameter `T` in the current scope
--> $DIR/issue-21673.rs:10:7
help: the following trait defines an item `method`, perhaps you need to restrict type parameter `T` with it:
|
LL | fn call_method_2<T: Foo>(x: T) {
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
help: try using a conversion method
|
LL | guts: guts.to_string(),
- | ^^^^^ ^^^^^^^^^^^^
+ | +++++ ++++++++++++
error[E0308]: mismatched types
--> $DIR/issue-52820.rs:10:17
help: consider dereferencing the type
|
LL | let y: i32 = *x;
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/issue-59819.rs:30:18
help: consider dereferencing the borrow
|
LL | let b: i32 = *a;
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/issue-59819.rs:34:21
LL | #![deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/issue-61963.rs:18:1
| ^^^ help: use `dyn`: `dyn pub`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to 2 previous errors
help: if this is a `self` type, give it a parameter name
|
LL | pub fn foo(self: Box<Self>) { }
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | pub fn foo(_: Box<Self>) { }
- | ^^^^^^
+ | ~~~~~~
error: expected one of `:`, `@`, or `|`, found `<`
--> $DIR/issue-64252-self-type.rs:10:15
help: if this is a `self` type, give it a parameter name
|
LL | fn bar(self: Box<Self>) { }
- | ^^^^^^^^^
+ | ~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar(_: Box<Self>) { }
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 2 previous errors
help: consider `await`ing on the `Future`
|
LL | SadGirl {}.call().await?;
- | ^^^^^^
+ | ++++++
error: aborting due to previous error
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | async fn run<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
- | ^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++ ~ +++++++++++++++++++++++++++
error[E0277]: `<impl Foo as Foo>::Bar` cannot be sent between threads safely
--> $DIR/issue-79843-impl-trait-with-missing-bounds-on-async-fn.rs:24:20
help: introduce a type parameter with a trait bound instead of using `impl Trait`
|
LL | async fn run2<F: Foo>(_: &(), foo: F) -> std::io::Result<()> where <F as Foo>::Bar: Send {
- | ^^^^^^^^ ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~ ~ +++++++++++++++++++++++++++
error: aborting due to 2 previous errors
help: consider dereferencing the borrow
|
LL | *b
- | ^
+ | +
error[E0308]: `if` and `else` have incompatible types
--> $DIR/issue-82361.rs:16:9
|
help: consider removing the borrow
|
-LL | 1
- | --
+LL - &1
+LL + 1
+ |
error[E0308]: `if` and `else` have incompatible types
--> $DIR/issue-82361.rs:22:9
|
help: consider removing the borrow
|
-LL | 1
- | --
+LL - &mut 1
+LL + 1
+ |
error: aborting due to 3 previous errors
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | T1::<1>::C;
- | ^^
+ | ++
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
--> $DIR/issue-82566-1.rs:19:9
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | T2::<1, 2>::C;
- | ^^
+ | ++
error: expected one of `.`, `;`, `?`, `}`, or an operator, found `,`
--> $DIR/issue-82566-1.rs:20:9
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | T3::<1, 2, 3>::C;
- | ^^
+ | ++
error: aborting due to 3 previous errors
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | fn foo1() -> [(); Foo1::<10>::SUM] {
- | ^^
+ | ++
error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> $DIR/issue-82566-2.rs:21:26
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | fn foo2() -> [(); Foo2::<10, 20>::SUM] {
- | ^^
+ | ++
error: expected one of `.`, `?`, `]`, or an operator, found `,`
--> $DIR/issue-82566-2.rs:26:26
help: use `::<...>` instead of `<...>` to specify type or const arguments
|
LL | fn foo3() -> [(); Foo3::<10, 20, 30>::SUM] {
- | ^^
+ | ++
error: aborting due to 3 previous errors
help: consider introducing a named lifetime parameter
|
LL | fn two_lifetimes_needed<'a>(a: &'a (), b: &'a ()) -> TwoLifetimes<'a, 'a> {
- | ^^^^ ^^^^^^ ^^^^^^ ^^ ^^
+ | ++++ ~~~~~~ ~~~~~~ ~~ ~~
error: aborting due to previous error
help: add missing lifetime argument
|
LL | type Bar<'a>: Deref<Target = <Self>::Bar<'a, Target = Self>>;
- | ^^^
+ | +++
error: aborting due to previous error
help: use a trailing comma to create a tuple with one element
|
LL | let _x: (i32,) = (5,);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/issue-86100-tuple-paren-comma.rs:13:9
help: use a trailing comma to create a tuple with one element
|
LL | foo((Some(3),));
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-86100-tuple-paren-comma.rs:17:22
help: use a trailing comma to create a tuple with one element
|
LL | let _s = S { _s: ("abc".to_string(),) };
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/issue-86100-tuple-paren-comma.rs:23:22
help: consider introducing a named lifetime parameter
|
LL | async fn a<'a>(s1: &'a str, s2: &'a str) -> &'a str {
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | ++++ ~~~~~~~ ~~~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/issue-86667.rs:11:29
help: consider introducing a named lifetime parameter
|
LL | fn b<'a>(s1: &'a str, s2: &'a str) -> &'a str {
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^^
+ | ++++ ~~~~~~~ ~~~~~~~ ~~~
error: aborting due to 2 previous errors
help: to allow this `impl Trait` to capture borrowed data with lifetime `'1`, add `'_` as a bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
- | ^^^^
+ | ++++
error: lifetime may not live long enough
--> $DIR/trait-object-nested-in-impl-trait.rs:39:9
help: to allow this `impl Trait` to capture borrowed data with lifetime `'a`, add `'a` as a bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
- | ^^^^
+ | ++++
error: aborting due to 4 previous errors
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo>> + '_ {
- | ^^^^
+ | ++++
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> {
- | ^^^^
+ | ++++
error[E0759]: `self` has an anonymous lifetime `'_` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/trait-object-nested-in-impl-trait.rs:41:31
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'_` lifetime bound
|
LL | fn iter(&self) -> impl Iterator<Item = Box<dyn Foo + '_>> + '_ {
- | ^^^^
+ | ++++
error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/trait-object-nested-in-impl-trait.rs:52:31
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo + 'a>> + 'a {
- | ^^^^
+ | ++++
error[E0759]: `self` has lifetime `'a` but it needs to satisfy a `'static` lifetime requirement
--> $DIR/trait-object-nested-in-impl-trait.rs:63:31
help: to declare that the `impl Trait` captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo>> + 'a {
- | ^^^^
+ | ++++
help: to declare that the trait object captures data from argument `self`, you can add an explicit `'a` lifetime bound
|
LL | fn iter<'a>(&'a self) -> impl Iterator<Item = Box<dyn Foo + 'a>> {
- | ^^^^
+ | ++++
error: aborting due to 4 previous errors
help: consider using a semicolon here
|
LL | foo();
- | ^
+ | +
help: consider using a semicolon here
|
LL | };
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/match-needing-semi.rs:11:5
help: consider `await`ing on the `Future`
|
LL | false => async_dummy().await,
- | ^^^^^^
+ | ++++++
help: consider removing this semicolon
|
-LL | async_dummy()
- | --
+LL - async_dummy();
+LL + async_dummy()
+ |
error[E0308]: `match` arms have incompatible types
--> $DIR/match-prev-arm-needing-semi.rs:45:18
help: consider `await`ing on the `Future`
|
LL | false => async_dummy2().await,
- | ^^^^^^
+ | ++++++
help: consider removing this semicolon and boxing the expressions
|
-LL | Box::new(async_dummy())
+LL ~ Box::new(async_dummy())
LL |
LL | }
-LL | false => Box::new(async_dummy2()),
+LL ~ false => Box::new(async_dummy2()),
|
error[E0308]: `match` arms have incompatible types
= note: distinct uses of `impl Trait` result in different opaque types
help: consider `await`ing on both `Future`s
|
-LL | true => async_dummy().await,
+LL ~ true => async_dummy().await,
LL |
-LL | false => async_dummy2().await,
+LL ~ false => async_dummy2().await,
|
error[E0308]: `match` arms have incompatible types
help: use parentheses to call the method
|
LL | let _ = vec![].into_iter().collect::<usize>();
- | ^^
+ | ++
error: aborting due to 2 previous errors
help: consider using the `'static` lifetime
|
LL | const A: &'static str = "";
- | ^^^^^^^
+ | +++++++
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
-LL | const A: &'a str = "";
+LL ~ trait ZstAssert<'a>: Sized {
+LL ~ const A: &'a str = "";
|
error[E0106]: missing lifetime specifier
help: consider using the `'static` lifetime
|
LL | const B: S<'static> = S { s: &() };
- | ^^^^^^^^^
+ | +++++++++
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
+LL ~ trait ZstAssert<'a>: Sized {
LL | const A: &str = "";
-LL | const B: S<'a> = S { s: &() };
+LL ~ const B: S<'a> = S { s: &() };
|
error[E0106]: missing lifetime specifier
help: consider using the `'static` lifetime
|
LL | const C: &'static str = "";
- | ^^^^^^^
+ | ~~~~~~~
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
+LL ~ trait ZstAssert<'a>: Sized {
LL | const A: &str = "";
LL | const B: S = S { s: &() };
-LL | const C: &'a str = "";
+LL ~ const C: &'a str = "";
|
error[E0106]: missing lifetime specifiers
help: consider using the `'static` lifetime
|
LL | const D: T<'static, 'static> = T { a: &(), b: &() };
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
help: consider introducing a named lifetime parameter
|
-LL | trait ZstAssert<'a>: Sized {
+LL ~ trait ZstAssert<'a>: Sized {
LL | const A: &str = "";
LL | const B: S = S { s: &() };
LL | const C: &'_ str = "";
-LL | const D: T<'a, 'a> = T { a: &(), b: &() };
+LL ~ const D: T<'a, 'a> = T { a: &(), b: &() };
|
error: aborting due to 4 previous errors
help: consider using the `'static` lifetime
|
LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:18:44
help: consider using the `'static` lifetime
|
LL | static a: RefCell<HashMap<i32, Vec<Vec<Foo<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:23:44
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:23:45
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:23:44
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&'static Bar>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:23:45
help: consider using the `'static` lifetime
|
LL | static b: RefCell<HashMap<i32, Vec<Vec<&Bar<'static, 'static>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:30:48
help: consider using the `'static` lifetime
|
LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:30:48
help: consider using the `'static` lifetime
|
LL | static c: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:35:44
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:35:49
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:35:44
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&'static Tar<i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifiers
--> $DIR/missing-lifetime-specifier.rs:35:49
help: consider using the `'static` lifetime
|
LL | static d: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this union takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:43:44
help: add missing lifetime argument
|
LL | static e: RefCell<HashMap<i32, Vec<Vec<Qux<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:50:44
help: consider using the `'static` lifetime
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0106]: missing lifetime specifier
--> $DIR/missing-lifetime-specifier.rs:50:44
help: consider using the `'static` lifetime
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&'static Tar<'static, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, 'k, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing-lifetime-specifier.rs:50:45
help: add missing lifetime argument
|
LL | static f: RefCell<HashMap<i32, Vec<Vec<&Tar<'static, '_, i32>>>>> = RefCell::new(HashMap::new());
- | ^^^^
+ | ++++
error: aborting due to 22 previous errors
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | struct S<'a>(&'a dyn for<'b> Fn(&'b X) -> &'b X);
- | ^^^^^^^ ^^^^^ ^^^
+ | +++++++ ~~~~~ ~~~
help: consider using the `'a` lifetime
|
LL | struct S<'a>(&'a dyn Fn(&X) -> &'a X);
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lt-for-hrtb.rs:2:33
help: consider making the bound lifetime-generic with a new `'b` lifetime
|
LL | struct S<'a>(&'a dyn for<'b> Fn(&'b X) -> &X<'b>);
- | ^^^^^^^ ^^^^^ ^^^^^
+ | +++++++ ~~~~~ ~~~~~
help: consider using the `'a` lifetime
|
LL | struct S<'a>(&'a dyn Fn(&X) -> &X<'a>);
- | ^^^^^
+ | ~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lt-for-hrtb.rs:5:40
help: consider using one of the available lifetimes here
|
LL | struct V<'a>(&'a dyn for<'b> Fn(&X) -> &'lifetime X);
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/missing-lt-for-hrtb.rs:5:41
help: consider restricting type parameter `T`
|
LL | pub fn foo<T: std::cmp::PartialEq>(s: &[T], t: &[T]) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to previous error
help: consider restricting the type parameters to satisfy the trait bounds
|
LL | struct Foo<T> where T: Bar, T: Default {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++
error[E0599]: the method `foo` exists for reference `&Fin<T>`, but its trait bounds were not satisfied
--> $DIR/missing-trait-bounds-for-method-call.rs:27:14
help: consider restricting the type parameter to satisfy the trait bound
|
LL | struct Fin<T> where T: Bar, T: Default {
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 2 previous errors
help: if you meant to use the unicode code point for 'µ', use a \xHH escape
|
LL | b'\xB5';
- | ^^^^
+ | ~~~~
error: non-ASCII character in byte constant
--> $DIR/multibyte-escapes.rs:9:7
help: if you meant to use the UTF-8 encoding of '字', use \xHH escapes
|
LL | b"\xE5\xAD\x97";
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to 3 previous errors
help: consider dereferencing here to assign to the mutable borrowed piece of memory
|
LL | *opt = None;
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/mut-ref-reassignment.rs:6:11
help: consider dereferencing here to assign to the mutable borrowed piece of memory
|
LL | *opt = Some(String::new())
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/mut-ref-reassignment.rs:14:11
help: one of the expressions' fields has a field of the same name
|
LL | let _test = &fooer.first.bar.c;
- | ^^^^^^^^^^
+ | ++++++++++
error[E0609]: no field `test` on type `Foo`
--> $DIR/non-existent-field-present-in-subfield.rs:40:24
help: one of the expressions' fields has a field of the same name
|
LL | let _test2 = fooer.first.bar.c.test;
- | ^^^^^^^^^^^^
+ | ++++++++++++
error: aborting due to 2 previous errors
help: you might have meant to use `Self` to refer to the implementing type
|
LL | fn f(a: Self) -> Self;
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error[E0038]: the trait `A` cannot be made into an object
--> $DIR/object-unsafe-trait-should-use-self.rs:3:13
help: you might have meant to use `Self` to refer to the implementing type
|
LL | fn f(a: Self) -> Self;
- | ^^^^ ^^^^
+ | ~~~~ ~~~~
error[E0038]: the trait `B` cannot be made into an object
--> $DIR/object-unsafe-trait-should-use-self.rs:8:13
help: consider turning `f` into a method by giving it a `&self` argument
|
LL | fn f(&self, a: B) -> B;
- | ^^^^^^
+ | ++++++
help: alternatively, consider constraining `f` so it does not apply to trait objects
|
LL | fn f(a: B) -> B where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 4 previous errors
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self) where Self: Other, { }
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Other, Self: Sized, { }
- | ^^^^^^^^^^^^^
+ | +++++++++++++
help: consider changing method `bar`'s `self` parameter to be `&self`
|
LL | fn bar(self: &Self) {}
- | ^^^^^
+ | ~~~~~
error: aborting due to 2 previous errors
= note: distinct uses of `impl Trait` result in different opaque types
help: consider `await`ing on both `Future`s
|
-LL | thing_one().await
+LL ~ thing_one().await
LL | } else {
-LL | thing_two().await
+LL ~ thing_two().await
|
error: aborting due to previous error
help: consider borrowing the `Option`'s content
|
LL | if selection.1.as_ref().unwrap().contains(selection.0) {
- | ^^^^^^^^^
+ | +++++++++
error[E0507]: cannot move out of `selection.1` which is behind a shared reference
--> $DIR/option-content-move.rs:29:20
help: consider borrowing the `Result`'s content
|
LL | if selection.1.as_ref().unwrap().contains(selection.0) {
- | ^^^^^^^^^
+ | +++++++++
error: aborting due to 2 previous errors
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f(p: &Path) { }
- | ^
+ | +
error: aborting due to previous error
help: use `br` for a raw byte string
|
LL | br"abc";
- | ^^
+ | ~~
error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `"abc"`
--> $DIR/raw-byte-string-prefix.rs:6:7
help: you can escape reserved keywords to use them as identifiers
|
LL | pub fn r#break() {}
- | ^^^^^^^
+ | ~~~~~~~
error: expected identifier, found keyword `let`
--> $DIR/raw-name-use-suggestion.rs:7:10
help: you can escape reserved keywords to use them as identifiers
|
LL | foo::r#let();
- | ^^^^^
+ | ~~~~~
error[E0425]: cannot find function `r#break` in this scope
--> $DIR/raw-name-use-suggestion.rs:8:5
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + +
error: generic parameters without surrounding angle brackets
--> $DIR/recover-missing-turbofish-surrounding-angle-braket.rs:4:48
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + ~
error: generic parameters without surrounding angle brackets
--> $DIR/recover-missing-turbofish-surrounding-angle-braket.rs:6:48
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + ~
error: generic parameters without surrounding angle brackets
--> $DIR/recover-missing-turbofish-surrounding-angle-braket.rs:8:48
help: surround the type parameters with angle brackets
|
LL | let _ = vec![1, 2, 3].into_iter().collect::<Vec<_>>();
- | ^ ^
+ | + ~
error: aborting due to 4 previous errors
help: consider further restricting this bound
|
LL | fn use_impl_sync(val: impl Sync + std::marker::Send) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:8:13
help: consider further restricting this bound
|
LL | fn use_where<S>(val: S) where S: Sync + std::marker::Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:12:13
help: consider further restricting this bound
|
LL | fn use_bound<S: Sync + std::marker::Send>(val: S) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:20:13
help: consider further restricting this bound
|
LL | Sync + std::marker::Send
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:24:13
help: consider further restricting this bound
|
LL | fn use_bound_and_where<S: Sync>(val: S) where S: std::fmt::Debug + std::marker::Send {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0277]: `S` cannot be sent between threads safely
--> $DIR/restrict-type-argument.rs:28:13
help: consider restricting type parameter `S`
|
LL | fn use_unbound<S: std::marker::Send>(val: S) {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to 6 previous errors
help: consider using the `'static` lifetime
|
LL | fn f1() -> &'static i32 { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:8:14
help: consider using the `'static` lifetime
|
LL | fn f1_() -> (&'static i32, &i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:8:20
help: consider using the `'static` lifetime
|
LL | fn f1_() -> (&i32, &'static i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:12:26
help: consider using the `'static` lifetime
|
LL | fn f2(a: i32, b: i32) -> &'static i32 { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:14:28
help: consider using the `'static` lifetime
|
LL | fn f2_(a: i32, b: i32) -> (&'static i32, &i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:14:34
help: consider using the `'static` lifetime
|
LL | fn f2_(a: i32, b: i32) -> (&i32, &'static i32) { loop {} }
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:19:17
help: consider introducing a named lifetime parameter
|
LL | fn f3<'a>(s: &'a S) -> &'a i32 { loop {} }
- | ^^^^ ^^^^^ ^^^
+ | ++++ ~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:21:26
help: consider introducing a named lifetime parameter
|
LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&'a i32, &i32) { loop {} }
- | ^^^^ ^^^^^ ^^^^^ ^^^
+ | ++++ ~~~~~ ~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:21:32
help: consider introducing a named lifetime parameter
|
LL | fn f3_<'a>(s: &'a S, t: &'a S) -> (&i32, &'a i32) { loop {} }
- | ^^^^ ^^^^^ ^^^^^ ^^^
+ | ++++ ~~~~~ ~~~~~ ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:25:42
help: consider using one of the available lifetimes here
|
LL | fn f4<'a, 'b>(a: &'a i32, b: &'b i32) -> &'lifetime i32 { loop {} }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:27:44
help: consider using one of the available lifetimes here
|
LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&'lifetime i32, &i32) { loop {} }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:27:50
help: consider using one of the available lifetimes here
|
LL | fn f4_<'a, 'b>(a: &'a i32, b: &'b i32) -> (&i32, &'lifetime i32) { loop {} }
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:31:35
help: consider using the `'a` lifetime
|
LL | fn f5<'a>(a: &'a i32, b: &i32) -> &'a i32 { loop {} }
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:33:37
help: consider using the `'a` lifetime
|
LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&'a i32, &i32) { loop {} }
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-elided-lifetime.rs:33:43
help: consider using the `'a` lifetime
|
LL | fn f5_<'a>(a: &'a i32, b: &i32) -> (&i32, &'a i32) { loop {} }
- | ^^^
+ | ~~~
error: aborting due to 15 previous errors
help: consider using the `'a` lifetime
|
LL | struct Foo<'a>(&'a usize);
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-without-lifetime.rs:5:34
help: consider using the `'a` lifetime
|
LL | fn func1<'a>(_arg: &'a Thing) -> &'a () { unimplemented!() }
- | ^^^
+ | ~~~
error[E0106]: missing lifetime specifier
--> $DIR/return-without-lifetime.rs:7:35
help: consider using the `'a` lifetime
|
LL | fn func2<'a>(_arg: &Thing<'a>) -> &'a () { unimplemented!() }
- | ^^^
+ | ~~~
error: aborting due to 3 previous errors
= note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html
help: store this in the heap by calling `Box::new`
|
-LL | let _x: Box<dyn Fn() -> Result<(), ()>> = Box::new(|| {
+LL ~ let _x: Box<dyn Fn() -> Result<(), ()>> = Box::new(|| {
LL | Err(())?;
LL | Ok(())
-LL | });
+LL ~ });
|
error: aborting due to previous error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider removing the leading `&`-reference
|
-LL | let mut stream_reader = BufReader::new(stream);
- | --
+LL - let mut stream_reader = BufReader::new(&stream);
+LL + let mut stream_reader = BufReader::new(stream);
+ |
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn issue_81421<T: Read + Write>(mut stream: T) where &T: std::io::Read {
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++
help: consider changing this borrow's mutability
|
LL | let mut stream_reader = BufReader::new(&mut stream);
- | ^^^^
+ | ~~~~
error[E0599]: the method `read_until` exists for struct `BufReader<&T>`, but its trait bounds were not satisfied
--> $DIR/suggest-change-mut.rs:16:23
help: give this closure an explicit return type without `_` placeholders
|
LL | let _v = || -> [_; 0] { [] };
- | ^^^^^^
+ | ~~~~~~
error: aborting due to previous error
help: give this closure an explicit return type without `_` placeholders
|
LL | let _v = || -> [_; 0] { [] };
- | ^^^^^^^^^
+ | +++++++++
error: aborting due to previous error
help: give this closure an explicit return type without `_` placeholders
|
LL | let _v = || -> [_; 0] { [] };
- | ^^^^^^^^^^^ ^
+ | +++++++++++ +
error: aborting due to previous error
help: move the constraint after the generic argument
|
LL | struct A<T, M: One<T, A = ()>> {
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:33:43
help: move the constraint after the generic arguments
|
LL | struct Al<'a, T, M: OneWithLifetime<'a, T, A = ()>> {
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:40:46
help: move the constraints after the generic arguments
|
LL | struct B<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:48:71
help: move the constraints after the generic arguments
|
LL | struct Bl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:57:28
help: move the constraints after the generic arguments
|
LL | struct C<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:65:53
help: move the constraints after the generic arguments
|
LL | struct Cl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:74:28
help: move the constraints after the generic arguments
|
LL | struct D<T, U, V, M: Three<T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: generic arguments must come before the first constraint
--> $DIR/suggest-move-types.rs:82:53
help: move the constraints after the generic arguments
|
LL | struct Dl<'a, 'b, 'c, T, U, V, M: ThreeWithLifetime<'a, 'b, 'c, T, U, V, A = (), B = (), C = ()>> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0747]: type provided when a lifetime was expected
--> $DIR/suggest-move-types.rs:33:43
help: if you meant to create this closure and immediately call it, surround the closure with parenthesis
|
LL | let _ = (||{})();
- | ^ ^
+ | + +
error: aborting due to previous error
help: you are looking for the module in `std`, not the primitive type
|
LL | let pi = std::f32::consts::PI;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error[E0599]: no function or associated item named `from_utf8` found for type `str` in the current scope
--> $DIR/suggest-std-when-using-type.rs:5:14
help: you are looking for the module in `std`, not the primitive type
|
LL | std::str::from_utf8(bytes)
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
|
LL | fn foo<'a, T: Trait + 'a>(&self, _: impl Trait, x: impl Trait<A = usize>, _: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:17:13
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn ban<T>(x: T) where T: Trait<A = usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:22:9
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
|
LL | fn foo<'a, T: Trait + 'a>(_: impl Trait, x: impl Trait<A = usize>, _: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:26:9
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn bar<T: Trait<A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:30:9
help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
|
LL | fn foo2(x: impl Trait<i32, A = usize>) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:34:9
help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
|
LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction-fixable.rs:38:9
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn ban<T>(x: T) where T: Trait<A = usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to 7 previous errors
help: consider constraining the associated type `<impl Trait as Trait>::A` to `usize`
|
LL | fn foo(_: impl Trait, x: impl Trait<A = usize>) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:18:9
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn bar<T: Trait<A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:22:9
help: consider constraining the associated type `<impl Trait<i32> as Trait<i32>>::A` to `usize`
|
LL | fn foo2(x: impl Trait<i32, A = usize>) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:26:12
help: consider constraining the associated type `<T as Trait<i32>>::A` to `{integer}`
|
LL | fn bar2<T: Trait<i32, A = {integer}>>(x: T) {
- | ^^^^^^^^^^^^^^^
+ | +++++++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:27:9
help: consider constraining the associated type `<T as Trait<i32>>::A` to `usize`
|
LL | fn bar2<T: Trait<i32, A = usize>>(x: T) {
- | ^^^^^^^^^^^
+ | +++++++++++
error[E0308]: mismatched types
--> $DIR/trait-with-missing-associated-type-restriction.rs:31:9
help: consider constraining the associated type `<T as Trait>::A` to `usize`
|
LL | fn ban<T>(x: T) where T: Trait<A = usize> {
- | ^^^^^^^^^^^
+ | +++++++++++
error: aborting due to 9 previous errors
help: consider using a semicolon here
|
LL | x?;
- | ^
+ | +
help: consider using a semicolon here
|
LL | };
- | ^
+ | +
error: aborting due to 2 previous errors
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo1(bar: &str) {}
- | ^
+ | +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized-function-parameter.rs:11:9
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo2(_bar: &str) {}
- | ^
+ | +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized-function-parameter.rs:17:9
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo3(_: &str) {}
- | ^
+ | +
error: aborting due to 3 previous errors
help: specify the associated types
|
LL | i: Box<dyn T<usize, usize, A = usize, C = usize, B=usize>>,
- | ^^^^^^^^^ ^^^^^^^^^
+ | ~~~~~~~~~ ~~~~~~~~~
error: aborting due to 2 previous errors
help: add missing generic argument
|
LL | fn foo(c: Quux<T>) { assert!((false)); }
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
help: you can convert a `usize` to an `isize` and panic if the converted value doesn't fit
|
LL | fn f() -> isize { return g().try_into().unwrap(); }
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
LL | let _ = "ༀ༁༂༃༄༅༆༇༈༉༊་༌།༎༏༐༑༒༓༔༕༖༗༘༙༚༛༜༝༞༟༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿ཀཁགགྷངཅཆཇཉཊཋཌཌྷཎཏཐདདྷནཔཕབབྷམཙཚཛཛྷཝཞཟའཡརལཤཥསཧཨཀྵཪཫཬཱཱཱིིུུྲྀཷླྀཹེཻོཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun.to_owned() + " really fun!";
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
= note: required because it appears within the type `(A, B)`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, {}
- | --
+LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
+LL + impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait<A: ?Sized> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/unsized-bound.rs:2:30
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A, B> Trait<(A, B)> for (A, B) where B: ?Sized, {}
- | --
+LL - impl<A, B> Trait<(A, B)> for (A, B) where A: ?Sized, B: ?Sized, {}
+LL + impl<A, B> Trait<(A, B)> for (A, B) where B: ?Sized, {}
+ |
error[E0277]: the size for values of type `C` cannot be known at compilation time
--> $DIR/unsized-bound.rs:5:31
= note: required because it appears within the type `(A, B, C)`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A, B: ?Sized, C> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- | --
+LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+LL + impl<A, B: ?Sized, C> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait<A: ?Sized> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/unsized-bound.rs:5:52
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) {}
- | --
+LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+LL + impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) {}
+ |
error[E0277]: the size for values of type `B` cannot be known at compilation time
--> $DIR/unsized-bound.rs:5:52
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A, B, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
- | --
+LL - impl<A, B: ?Sized, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+LL + impl<A, B, C: ?Sized> Trait<(A, B, C)> for (A, B, C) where A: ?Sized, {}
+ |
error[E0277]: the size for values of type `B` cannot be known at compilation time
--> $DIR/unsized-bound.rs:10:28
= note: required because it appears within the type `(A, B)`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A: ?Sized, B> Trait2<(A, B)> for (A, B) {}
- | --
+LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+LL + impl<A: ?Sized, B> Trait2<(A, B)> for (A, B) {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait2<A: ?Sized> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/unsized-bound.rs:10:47
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A, B: ?Sized> Trait2<(A, B)> for (A, B) {}
- | --
+LL - impl<A: ?Sized, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+LL + impl<A, B: ?Sized> Trait2<(A, B)> for (A, B) {}
+ |
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/unsized-bound.rs:14:9
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A> Trait3<A> for A {}
- | --
+LL - impl<A> Trait3<A> for A where A: ?Sized {}
+LL + impl<A> Trait3<A> for A {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait3<A: ?Sized> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `A` cannot be known at compilation time
--> $DIR/unsized-bound.rs:17:17
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<A> Trait4<A> for A {}
- | --
+LL - impl<A: ?Sized> Trait4<A> for A {}
+LL + impl<A> Trait4<A> for A {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait4<A: ?Sized> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-bound.rs:20:12
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X, Y> Trait5<X, Y> for X {}
- | --
+LL - impl<X, Y> Trait5<X, Y> for X where X: ?Sized {}
+LL + impl<X, Y> Trait5<X, Y> for X {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait5<A: ?Sized, B> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-bound.rs:23:20
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X, Y> Trait6<X, Y> for X {}
- | --
+LL - impl<X: ?Sized, Y> Trait6<X, Y> for X {}
+LL + impl<X, Y> Trait6<X, Y> for X {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait6<A: ?Sized, B> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Y` cannot be known at compilation time
--> $DIR/unsized-bound.rs:26:12
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X, Y> Trait7<X, Y> for X {}
- | --
+LL - impl<X, Y> Trait7<X, Y> for X where Y: ?Sized {}
+LL + impl<X, Y> Trait7<X, Y> for X {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait7<A, B: ?Sized> {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `Y` cannot be known at compilation time
--> $DIR/unsized-bound.rs:29:20
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X, Y> Trait8<X, Y> for X {}
- | --
+LL - impl<X, Y: ?Sized> Trait8<X, Y> for X {}
+LL + impl<X, Y> Trait8<X, Y> for X {}
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait Trait8<A, B: ?Sized> {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 13 previous errors
help: consider further restricting type parameter `X`
|
LL | trait InsufficientlyConstrainedGeneric<X=()> where X: std::marker::Copy {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++
error: aborting due to previous error
help: disambiguate the associated function for candidate #1
|
LL | A::foo(&t);
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: disambiguate the associated function for candidate #2
|
LL | B::foo(&t);
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | trait B<T: Foo> = A<T>;
- | ^^^^^
+ | +++++
error: aborting due to previous error
help: constrain the associated type to `String`
|
LL | struct Foo<T> where T: Bar, T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | struct Foo<T> where T: Bar, <T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:9:54
help: constrain the associated type to `String`
|
LL | struct Qux<'a, T> where T: Bar, &'a T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | struct Qux<'a, T> where T: Bar, <&'a T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:13:45
help: constrain the associated type to `String`
|
LL | fn foo<T: Bar>(_: T) where T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | fn foo<T: Bar>(_: T) where <T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error[E0404]: expected trait, found struct `String`
--> $DIR/assoc_type_bound_with_struct.rs:16:57
help: constrain the associated type to `String`
|
LL | fn qux<'a, T: Bar>(_: &'a T) where &'a T: Bar<Baz = String> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
help: a trait with a similar name exists
|
LL | fn qux<'a, T: Bar>(_: &'a T) where <&'a T as Bar>::Baz: ToString {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to 4 previous errors
help: consider further restricting this bound
|
LL | fn foo<T:'static + std::marker::Send>() {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
|
= note: `#[warn(bare_trait_objects)]` on by default
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time
--> $DIR/not-on-bare-trait.rs:7:8
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn foo(_x: &Foo + Send) {
- | ^
+ | +
error: aborting due to previous error; 1 warning emitted
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn a() -> A {
- | --
+LL - fn a() -> A + 'static {
+LL + fn a() -> A {
+ |
error[E0404]: expected trait, found enum `Result`
--> $DIR/not-on-struct.rs:16:34
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
- | --
+LL - fn b<'a,T,E>(iter: Iterator<Item=Result<T,E> + 'a>) {
+LL + fn b<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
+ |
error[E0404]: expected trait, found struct `A`
--> $DIR/not-on-struct.rs:19:21
| ...because of this bound
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn c() -> A {
- | --
+LL - fn c() -> 'static + A {
+LL + fn c() -> A {
+ |
error[E0404]: expected trait, found enum `Result`
--> $DIR/not-on-struct.rs:22:39
| ...because of this bound
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
- | --
+LL - fn d<'a,T,E>(iter: Iterator<Item='a + Result<T,E>>) {
+LL + fn d<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
+ |
error[E0404]: expected trait, found struct `A`
--> $DIR/not-on-struct.rs:25:21
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn e() -> A {
- | ---
+LL - fn e() -> 'static + A + 'static {
+LL + fn e() -> A {
+ |
error[E0404]: expected trait, found enum `Result`
--> $DIR/not-on-struct.rs:29:39
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
- | -- --
+LL - fn f<'a,T,E>(iter: Iterator<Item='a + Result<T,E> + 'a>) {
+LL + fn f<'a,T,E>(iter: Iterator<Item=Result<T,E>>) {
+ |
error[E0404]: expected trait, found struct `Traitor`
--> $DIR/not-on-struct.rs:35:11
| expected this type to be a trait...
help: if you meant to use a type and not a trait here, remove the bounds
|
-LL | fn g() -> Traitor {
- | --
+LL - fn g() -> Traitor + 'static {
+LL + fn g() -> Traitor {
+ |
help: a trait with a similar name exists
|
LL | fn g() -> Trait + 'static {
- | ^^^^^
+ | ~~~~~
error: aborting due to 11 previous errors
help: consider restricting type parameter `T`
|
LL | impl<T: Trait> Foo<T> {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `isize: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:19:8
help: consider restricting type parameter `U`
|
LL | struct Badness<U: Trait> {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `V: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:31:21
help: consider restricting type parameter `V`
|
LL | enum MoreBadness<V: Trait> {
- | ^^^^^^^
+ | +++++++
error[E0277]: the trait bound `i32: Trait` is not satisfied
--> $DIR/on-structs-and-enums.rs:35:5
help: consider further restricting this bound
|
LL | impl<T: Magic + std::marker::Sync> Magic for T {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error[E0275]: overflow evaluating the requirement `*mut (): Magic`
--> $DIR/two-traits.rs:20:5
help: consider further restricting this bound
|
LL | fn with_trait<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool {
- | ^^^^^^^^^^^^^^^^
+ | ++++++++++++++++
error[E0277]: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied
--> $DIR/repeated-supertrait-ambig.rs:34:5
help: consider further restricting this bound
|
LL | fn with_ufcs2<C:CompareToInts + CompareTo<i32>>(c: &C) -> bool {
- | ^^^^^^^^^^^^^^^^
+ | ++++++++++++++++
error[E0277]: the trait bound `i64: CompareTo<i32>` is not satisfied
--> $DIR/repeated-supertrait-ambig.rs:42:23
help: the following trait defines an item `foo`, perhaps you need to restrict type parameter `T` with it:
|
LL | fn do_stuff<T: Foo + Bar>(t : T) {
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider turning `map` into a method by giving it a `&self` argument
|
LL | fn map(&self)
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `map` so it does not apply to trait objects
|
LL | where for<'a> &'a mut [dyn Bar]:, Self: Sized ;
- | ^^^^^^^^^^^^^
+ | +++++++++++++
error: aborting due to previous error
help: a type parameter with a similar name exists
|
LL | impl<T> DispatchFromDyn<Smaht<T, MISC>> for T {}
- | ^
+ | ~
help: you might be missing a type parameter
|
LL | impl<T, U> DispatchFromDyn<Smaht<U, MISC>> for T {}
- | ^^^
+ | +++
error[E0412]: cannot find type `MISC` in this scope
--> $DIR/issue-78372.rs:3:34
help: change the type of the numeric literal from `i32` to `u32`
|
LL | test(22i32, 44u32);
- | ^^^^^
+ | ~~~~~
error: aborting due to previous error
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0038]: the trait `Tr` cannot be made into an object
--> $DIR/safety.rs:15:12
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self);
- | ^^^^^
+ | +++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects
|
LL | fn foo() where Self: Sized;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
help: add missing generic argument
|
LL | let _: S<'static, 'static, T>;
- | ^^^
+ | +++
error[E0224]: at least one trait is required for an object type
--> $DIR/vs-lifetime.rs:14:14
help: consider further restricting this bound
|
LL | fn foo<T: MyMul<f64, f64> + std::ops::Mul<Output = f64>>(a: &T, b: f64) -> f64 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++
error: aborting due to previous error
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn check<T: Iterator, U>() {
- | --
+LL - fn check<T: Iterator, U: ?Sized>() {
+LL + fn check<T: Iterator, U>() {
+ |
error[E0277]: the size for values of type `U` cannot be known at compilation time
--> $DIR/suggest-where-clause.rs:10:5
| ^^^^
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn check<T: Iterator, U>() {
- | --
+LL - fn check<T: Iterator, U: ?Sized>() {
+LL + fn check<T: Iterator, U>() {
+ |
error[E0277]: the trait bound `u64: From<T>` is not satisfied
--> $DIR/suggest-where-clause.rs:15:5
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn check<T: Iterator, U: ?Sized>() where u64: From<T> {
- | ^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++
error[E0277]: the trait bound `u64: From<<T as Iterator>::Item>` is not satisfied
--> $DIR/suggest-where-clause.rs:18:5
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn check<T: Iterator, U: ?Sized>() where u64: From<<T as Iterator>::Item> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `Misc<_>: From<T>` is not satisfied
--> $DIR/suggest-where-clause.rs:23:5
help: consider borrowing the value
|
LL | let _ = &x as &dyn Bar<i32>; // FIXME: OK, eventually
- | ^
+ | +
error[E0605]: non-primitive cast: `&dyn Foo` as `&dyn Bar<u32>`
--> $DIR/type-checking-test-1.rs:15:13
help: consider borrowing the value
|
LL | let _ = &x as &dyn Bar<u32>; // FIXME: OK, eventually
- | ^
+ | +
error[E0277]: the trait bound `&dyn Foo: Bar<i32>` is not satisfied
--> $DIR/type-checking-test-1.rs:12:13
help: consider borrowing the value
|
LL | let _ = &x as &dyn Bar<_>; // Ambiguous
- | ^
+ | +
error[E0277]: the trait bound `&dyn Foo: Bar<_>` is not satisfied
--> $DIR/type-checking-test-1.rs:21:13
help: consider borrowing the value
|
LL | let a = &x as &dyn Bar<_>; // FIXME: OK, eventually
- | ^
+ | +
error[E0277]: the trait bound `&dyn Foo: Bar<u32>` is not satisfied
--> $DIR/type-checking-test-1.rs:27:13
help: consider borrowing the value
|
LL | let _ = &x as &dyn Bar<i32>; // FIXME: OK, eventually
- | ^
+ | +
error[E0277]: the trait bound `&dyn Foo<u32>: Bar<i32>` is not satisfied
--> $DIR/type-checking-test-2.rs:16:13
help: consider borrowing the value
|
LL | let _ = &x as &dyn Bar<u32>; // Error
- | ^
+ | +
error[E0277]: the trait bound `&dyn Foo<i32>: Bar<u32>` is not satisfied
--> $DIR/type-checking-test-2.rs:22:13
help: consider borrowing the value
|
LL | let a = &x as &dyn Bar<_>; // Ambiguous
- | ^
+ | +
error[E0277]: the trait bound `&dyn Foo<u32>: Bar<_>` is not satisfied
--> $DIR/type-checking-test-2.rs:28:13
help: you can convert an `i32` to a `u8` and panic if the converted value doesn't fit
|
LL | B::get_x().try_into().unwrap()
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
= note: `#[warn(type_alias_bounds)]` on by default
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type Y = ();
- | --
+LL - type Y where i32: Foo = ();
+LL + type Y = ();
+ |
warning: Trait bound i32: Foo does not depend on any type or lifetime parameters
--> $DIR/trivial-bounds-inconsistent.rs:22:19
help: use `!` to invoke the macro
|
LL | let try_result: Option<_> = try! {
- | ^
+ | +
error: aborting due to 2 previous errors
help: you can still access the deprecated `try!()` macro using the "raw identifier" syntax
|
LL | Ok(r#try!());
- | ^^
+ | ++
error: use of deprecated `try` macro
--> $DIR/try-macro-suggestion.rs:4:8
= note: in the 2018 edition `try` is a reserved keyword, and the `try!()` macro is deprecated
help: you can use the `?` operator instead
|
-LL | Ok(Ok(())?)
- | -- ^
+LL - Ok(try!(Ok(())))
+LL + Ok(Ok(())?)
+ |
help: alternatively, you can still access the deprecated `try!()` macro using the "raw identifier" syntax
|
LL | Ok(r#try!(Ok(())))
- | ^^
+ | ++
error: aborting due to 2 previous errors
help: you can convert an `i32` to a `u16` and panic if the converted value doesn't fit
|
LL | identity_u16(y.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/tutorial-suffix-inference-test.rs:21:18
help: you can convert an `isize` to a `u16` and panic if the converted value doesn't fit
|
LL | identity_u16(a.try_into().unwrap());
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
help: `Alias::Unit` is a unit variant, you need to write it without the parenthesis
|
LL | Alias::Unit;
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error[E0164]: expected tuple struct or tuple variant, found unit variant `Alias::Unit`
--> $DIR/incorrect-variant-form-through-alias-caught.rs:17:9
--- /dev/null
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/bounds-are-checked-2.rs:6:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error[E0277]: the trait bound `T: Clone` is not satisfied
+ --> $DIR/bounds-are-checked-2.rs:9:13
+ |
+LL | type X<T> = impl Clone;
+ | ^^^^^^^^^^ the trait `Clone` is not implemented for `T`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | type X<T: std::clone::Clone> = impl Clone;
+ | +++++++++++++++++++
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `T`
|
LL | type X<T: std::clone::Clone> = impl Clone;
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
--- /dev/null
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/generic_duplicate_param_use5.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use5.rs:19:1
+ |
+LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, U)`, got `(U, T)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use5.rs:15:1
+ |
+LL | fn two<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: `T` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use5.rs:11:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, U)`
+help: consider restricting type parameter `T`
+ |
+LL | type Two<T: std::fmt::Debug, U> = impl Debug;
+ | +++++++++++++++++
+
+error[E0277]: `U` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use5.rs:11:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, U)`
+help: consider restricting type parameter `U`
+ |
+LL | type Two<T, U: std::fmt::Debug> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 3 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `U` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use5.rs:8:18
help: consider restricting type parameter `U`
|
LL | type Two<T, U: std::fmt::Debug> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 3 previous errors
--- /dev/null
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/generic_duplicate_param_use6.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use6.rs:18:1
+ |
+LL | fn three<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, T)`, got `(U, T)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use6.rs:14:1
+ |
+LL | fn two<T: Copy + Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: `T` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use6.rs:11:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, T)`
+help: consider restricting type parameter `T`
+ |
+LL | type Two<T: std::fmt::Debug, U> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
--- /dev/null
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/generic_duplicate_param_use8.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use8.rs:17:1
+ |
+LL | fn three<T: Debug, U: Debug>(_: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(T, u32)`, got `(U, u32)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use8.rs:13:1
+ |
+LL | fn two<T: Debug, U: Debug>(t: T, _: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: `T` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use8.rs:10:18
+ |
+LL | type Two<T, U> = impl Debug;
+ | ^^^^^^^^^^ `T` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(T, u32)`
+help: consider restricting type parameter `T`
+ |
+LL | type Two<T: std::fmt::Debug, U> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `T`
|
LL | type Two<T: std::fmt::Debug, U> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
--- /dev/null
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/generic_duplicate_param_use9.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error: concrete type differs from previous defining opaque type use
+ --> $DIR/generic_duplicate_param_use9.rs:24:1
+ |
+LL | fn three<T: Debug, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `(A, B, <A as Foo>::Bar)`, got `(A, B, i32)`
+ |
+note: previous use here
+ --> $DIR/generic_duplicate_param_use9.rs:20:1
+ |
+LL | fn two<T: Debug + Foo, U: Debug>(t: T, u: U) -> Two<T, U> {
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: the trait bound `A: Foo` is not satisfied in `(A, B, <A as Foo>::Bar)`
+ --> $DIR/generic_duplicate_param_use9.rs:10:18
+ |
+LL | type Two<A, B> = impl Debug;
+ | ^^^^^^^^^^ within `(A, B, <A as Foo>::Bar)`, the trait `Foo` is not implemented for `A`
+ |
+ = note: required because it appears within the type `(A, B, <A as Foo>::Bar)`
+help: consider restricting type parameter `A`
+ |
+LL | type Two<A: Foo, B> = impl Debug;
+ | +++++
+
+error[E0277]: `A` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use9.rs:10:18
+ |
+LL | type Two<A, B> = impl Debug;
+ | ^^^^^^^^^^ `A` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
+help: consider restricting type parameter `A`
+ |
+LL | type Two<A: std::fmt::Debug, B> = impl Debug;
+ | +++++++++++++++++
+
+error[E0277]: `B` doesn't implement `Debug`
+ --> $DIR/generic_duplicate_param_use9.rs:10:18
+ |
+LL | type Two<A, B> = impl Debug;
+ | ^^^^^^^^^^ `B` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+ = note: required because of the requirements on the impl of `Debug` for `(A, B, <A as Foo>::Bar)`
+help: consider restricting type parameter `B`
+ |
+LL | type Two<A, B: std::fmt::Debug> = impl Debug;
+ | +++++++++++++++++
+
+error: aborting due to 4 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `A`
|
LL | type Two<A: Foo, B> = impl Debug;
- | ^^^^^
+ | +++++
error[E0277]: `A` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use9.rs:7:18
help: consider restricting type parameter `A`
|
LL | type Two<A: std::fmt::Debug, B> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `B` doesn't implement `Debug`
--> $DIR/generic_duplicate_param_use9.rs:7:18
help: consider restricting type parameter `B`
|
LL | type Two<A, B: std::fmt::Debug> = impl Debug;
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 4 previous errors
found opaque type `impl Sized`
error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:13:30
+ --> $DIR/generic_type_does_not_live_long_enough.rs:12:30
|
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
| ^^^^^^^^^^^^^^^
}
type WrongGeneric<T> = impl 'static;
-//~^ ERROR the parameter type `T` may not live long enough
-//~| ERROR: at least one trait must be specified
+//~^ ERROR: at least one trait must be specified
fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
+ //~^ ERROR the parameter type `T` may not live long enough
t
}
found opaque type `impl Sized`
error[E0310]: the parameter type `T` may not live long enough
- --> $DIR/generic_type_does_not_live_long_enough.rs:9:24
+ --> $DIR/generic_type_does_not_live_long_enough.rs:12:30
|
-LL | type WrongGeneric<T> = impl 'static;
- | ^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
-...
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
- | - help: consider adding an explicit lifetime bound...: `T: 'static`
+ | - ^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
+ | |
+ | help: consider adding an explicit lifetime bound...: `T: 'static`
error: aborting due to 3 previous errors
--- /dev/null
+error: at least one trait must be specified
+ --> $DIR/generic_underconstrained.rs:9:35
+ |
+LL | type Underconstrained<T: Trait> = impl 'static;
+ | ^^^^^^^^^^^^
+
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/generic_underconstrained.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error[E0277]: the trait bound `T: Trait` is not satisfied
+ --> $DIR/generic_underconstrained.rs:13:31
+ |
+LL | type Underconstrained<T: Trait> = impl 'static;
+ | ----- required by this bound in `Underconstrained`
+...
+LL | fn underconstrain<T>(_: T) -> Underconstrained<T> {
+ | ^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for `T`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
+ | +++++++
+
+error: aborting due to 2 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `T`
|
LL | fn underconstrain<T: Trait>(_: T) -> Underconstrained<T> {
- | ^^^^^^^
+ | +++++++
error: aborting due to 2 previous errors
--- /dev/null
+error: at least one trait must be specified
+ --> $DIR/generic_underconstrained2.rs:8:45
+ |
+LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
+ | ^^^^^^^^^^^^
+
+error: at least one trait must be specified
+ --> $DIR/generic_underconstrained2.rs:17:46
+ |
+LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
+ | ^^^^^^^^^^^^
+
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/generic_underconstrained2.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error[E0277]: `U` doesn't implement `Debug`
+ --> $DIR/generic_underconstrained2.rs:12:33
+ |
+LL | type Underconstrained<T: std::fmt::Debug> = impl 'static;
+ | --------------- required by this bound in `Underconstrained`
+...
+LL | fn underconstrained<U>(_: U) -> Underconstrained<U> {
+ | ^^^^^^^^^^^^^^^^^^^ `U` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+help: consider restricting type parameter `U`
+ |
+LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
+ | +++++++++++++++++
+
+error[E0277]: `V` doesn't implement `Debug`
+ --> $DIR/generic_underconstrained2.rs:21:43
+ |
+LL | type Underconstrained2<T: std::fmt::Debug> = impl 'static;
+ | --------------- required by this bound in `Underconstrained2`
+...
+LL | fn underconstrained2<U, V>(_: U, _: V) -> Underconstrained2<V> {
+ | ^^^^^^^^^^^^^^^^^^^^ `V` cannot be formatted using `{:?}` because it doesn't implement `Debug`
+ |
+help: consider restricting type parameter `V`
+ |
+LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
+ | +++++++++++++++++
+
+error: aborting due to 4 previous errors; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `U`
|
LL | fn underconstrained<U: std::fmt::Debug>(_: U) -> Underconstrained<U> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: `V` doesn't implement `Debug`
--> $DIR/generic_underconstrained2.rs:18:43
help: consider restricting type parameter `V`
|
LL | fn underconstrained2<U, V: std::fmt::Debug>(_: U, _: V) -> Underconstrained2<V> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 4 previous errors
--- /dev/null
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/issue-52843.rs:3:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error[E0277]: the trait bound `T: Default` is not satisfied
+ --> $DIR/issue-52843.rs:6:15
+ |
+LL | type Foo<T> = impl Default;
+ | ^^^^^^^^^^^^ the trait `Default` is not implemented for `T`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | type Foo<T: std::default::Default> = impl Default;
+ | +++++++++++++++++++++++
+
+error: aborting due to previous error; 1 warning emitted
+
+For more information about this error, try `rustc --explain E0277`.
help: consider restricting type parameter `T`
|
LL | type Foo<T: std::default::Default> = impl Default;
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++
error: aborting due to previous error
LL | |x| x
| ^^^^^
-error[E0308]: mismatched types
- --> $DIR/issue-57611-trait-alias.rs:17:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
- |
- = note: expected type `for<'r> Fn<(&'r X,)>`
- found type `Fn<(&'static X,)>`
-note: this closure does not fulfill the lifetime requirements
- --> $DIR/issue-57611-trait-alias.rs:21:9
- |
-LL | |x| x
- | ^^^^^
-
-error: implementation of `FnOnce` is not general enough
- --> $DIR/issue-57611-trait-alias.rs:17:16
- |
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
- |
- = note: closure with signature `fn(&'static X) -> &'static X` must implement `FnOnce<(&'0 X,)>`, for any lifetime `'0`...
- = note: ...but it actually implements `FnOnce<(&'static X,)>`
-
-error: aborting due to 4 previous errors
+error: aborting due to 2 previous errors
-For more information about this error, try `rustc --explain E0308`.
impl Foo for X {
type Bar = impl Baz<Self, Self>;
- //~^ ERROR implementation of `FnOnce` is not general enough
fn bar(&self) -> Self::Bar {
+ //~^ ERROR implementation of `FnOnce` is not general enough
|x| x
}
}
error: implementation of `FnOnce` is not general enough
- --> $DIR/issue-57611-trait-alias.rs:17:16
+ --> $DIR/issue-57611-trait-alias.rs:19:22
|
-LL | type Bar = impl Baz<Self, Self>;
- | ^^^^^^^^^^^^^^^^^^^^ implementation of `FnOnce` is not general enough
+LL | fn bar(&self) -> Self::Bar {
+ | ^^^^^^^^^ implementation of `FnOnce` is not general enough
|
= note: closure with signature `fn(&'2 X) -> &X` must implement `FnOnce<(&'1 X,)>`, for any lifetime `'1`...
= note: ...but it actually implements `FnOnce<(&'2 X,)>`, for some specific lifetime `'2`
impl Bug for &() {
type Item = impl Bug; //~ ERROR `impl Trait` in type aliases is unstable
- //~^ ERROR the trait bound `(): Bug` is not satisfied
const FUN: fn() -> Self::Item = || ();
- //~^ ERROR type alias impl trait is not permitted here
+ //~^ ERROR the trait bound `(): Bug` is not satisfied
}
fn main() {}
= note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
= help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-error[E0658]: type alias impl trait is not permitted here
- --> $DIR/issue-60371.rs:13:40
- |
-LL | const FUN: fn() -> Self::Item = || ();
- | ^
- |
- = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
- = help: add `#![feature(type_alias_impl_trait)]` to the crate attributes to enable
-
error[E0277]: the trait bound `(): Bug` is not satisfied
- --> $DIR/issue-60371.rs:10:17
+ --> $DIR/issue-60371.rs:12:40
|
-LL | type Item = impl Bug;
- | ^^^^^^^^ the trait `Bug` is not implemented for `()`
+LL | const FUN: fn() -> Self::Item = || ();
+ | ^ the trait `Bug` is not implemented for `()`
|
= help: the following implementations were found:
<&() as Bug>
-error: aborting due to 3 previous errors
+error: aborting due to 2 previous errors
Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
#![feature(type_alias_impl_trait)]
-type Closure = impl FnOnce(); //~ ERROR: type mismatch resolving
+type Closure = impl FnOnce();
fn c() -> Closure {
- || -> Closure { || () }
+ || -> Closure { || () } //~ ERROR: mismatched types
}
fn main() {}
-error[E0271]: type mismatch resolving `<[closure@$DIR/issue-63279.rs:8:5: 8:28] as FnOnce<()>>::Output == ()`
- --> $DIR/issue-63279.rs:5:16
+error[E0308]: mismatched types
+ --> $DIR/issue-63279.rs:8:5
|
LL | type Closure = impl FnOnce();
- | ^^^^^^^^^^^^^ expected `()`, found opaque type
+ | ------------- the found opaque type
+...
+LL | || -> Closure { || () }
+ | ^^^^^^^^^^^^^^^^^^^^^^^ expected closure, found a different closure
|
- = note: expected unit type `()`
- found opaque type `impl FnOnce<()>`
+ = note: expected type `[closure@$DIR/issue-63279.rs:8:21: 8:26]`
+ found closure `[closure@$DIR/issue-63279.rs:8:5: 8:28]`
+ = note: no two closures, even if identical, have the same type
+ = help: consider boxing your closure and/or using it as a trait object
error: aborting due to previous error
-For more information about this error, try `rustc --explain E0271`.
+For more information about this error, try `rustc --explain E0308`.
// compile-flags: -Zsave-analysis
+// check-pass
#![feature(type_alias_impl_trait, rustc_attrs)]
fn take(_: fn() -> T) {}
-#[rustc_error]
fn main() {
- //~^ ERROR fatal error triggered by #[rustc_error]
take(|| {});
take(|| {});
}
+++ /dev/null
-error: fatal error triggered by #[rustc_error]
- --> $DIR/issue-65679-inst-opaque-ty-from-val-twice.rs:15:1
- |
-LL | fn main() {
- | ^^^^^^^^^
-
-error: aborting due to previous error
-
fn test() -> Test {
let y = || -> Test { () };
- //~^ ERROR: concrete type differs from previous defining opaque type use
- 7
+ 7 //~ ERROR mismatched types
}
fn main() {}
-error: concrete type differs from previous defining opaque type use
- --> $DIR/issue-74280.rs:8:13
+error[E0308]: mismatched types
+ --> $DIR/issue-74280.rs:9:5
|
-LL | let y = || -> Test { () };
- | ^^^^^^^^^^^^^^^^^ expected `i32`, got `()`
- |
-note: previous use here
- --> $DIR/issue-74280.rs:7:1
- |
-LL | fn test() -> Test {
- | ^^^^^^^^^^^^^^^^^
+LL | 7
+ | ^ expected `()`, found integer
error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
#![feature(type_alias_impl_trait)]
type X<A, B> = impl Into<&'static A>;
-//~^ ERROR the trait bound `&'static B: From<&A>` is not satisfied
fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
+ //~^ ERROR the trait bound `&'static B: From<&A>` is not satisfied
(a, a)
}
error[E0277]: the trait bound `&'static B: From<&A>` is not satisfied
- --> $DIR/multiple-def-uses-in-one-fn.rs:7:16
+ --> $DIR/multiple-def-uses-in-one-fn.rs:9:45
|
-LL | type X<A, B> = impl Into<&'static A>;
- | ^^^^^^^^^^^^^^^^^^^^^ the trait `From<&A>` is not implemented for `&'static B`
+LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) {
+ | ^^^^^^^^^^^^^^^^^^ the trait `From<&A>` is not implemented for `&'static B`
|
= note: required because of the requirements on the impl of `Into<&'static B>` for `&A`
help: consider introducing a `where` bound, but there might be an alternative better way to express this requirement
|
LL | fn f<A, B: 'static>(a: &'static A, b: B) -> (X<A, B>, X<B, A>) where &'static B: From<&A> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++
error: aborting due to previous error
help: consider specifying the type arguments in the method call
|
LL | .or_else::<F, O>(|err| {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
help: consider specifying the type argument in the method call
|
LL | lst.sort_by_key(|&(v, _)| v.iter().sum::<S>());
- | ^^^^^
+ | +++++
error: aborting due to previous error
help: add missing generic argument
|
LL | input_cells: Vec<T>::new()
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 3 previous errors
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | pub type T<P> = P;
- | --
+LL - pub type T<P: Send + Send + Send> = P;
+LL + pub type T<P> = P;
+ |
warning: 1 warning emitted
= note: `#[warn(type_alias_bounds)]` on by default
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type SVec<T> = Vec<T>;
- | --
+LL - type SVec<T: Send + Send> = Vec<T>;
+LL + type SVec<T> = Vec<T>;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:10:21
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type S2Vec<T> = Vec<T>;
- | --
+LL - type S2Vec<T> where T: Send = Vec<T>;
+LL + type S2Vec<T> = Vec<T>;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:12:19
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type VVec<'b, 'a> = (&'b u32, Vec<&'a i32>);
- | --
+LL - type VVec<'b, 'a: 'b + 'b> = (&'b u32, Vec<&'a i32>);
+LL + type VVec<'b, 'a> = (&'b u32, Vec<&'a i32>);
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:14:18
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type WVec<'b, T> = (&'b u32, Vec<T>);
- | --
+LL - type WVec<'b, T: 'b + 'b> = (&'b u32, Vec<T>);
+LL + type WVec<'b, T> = (&'b u32, Vec<T>);
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:16:25
|
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type W2Vec<'b, T> = (&'b u32, Vec<T>);
- | --
+LL - type W2Vec<'b, T> where T: 'b, T: 'b = (&'b u32, Vec<T>);
+LL + type W2Vec<'b, T> = (&'b u32, Vec<T>);
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:47:12
| ^^^^^^^^
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type T1<U> = U::Assoc;
- | --
+LL - type T1<U: Bound> = U::Assoc;
+LL + type T1<U> = U::Assoc;
+ |
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:48:18
| ^^^^^^^^
help: the clause will not be checked when the type alias is used, and should be removed
|
-LL | type T2<U> = U::Assoc;
- | --
+LL - type T2<U> where U: Bound = U::Assoc;
+LL + type T2<U> = U::Assoc;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:56:12
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type T5<U> = <U as Bound>::Assoc;
- | --
+LL - type T5<U: Bound> = <U as Bound>::Assoc;
+LL + type T5<U> = <U as Bound>::Assoc;
+ |
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias-bounds.rs:57:12
|
help: the bound will not be checked when the type alias is used, and should be removed
|
-LL | type T6<U> = ::std::vec::Vec<U>;
- | --
+LL - type T6<U: Bound> = ::std::vec::Vec<U>;
+LL + type T6<U> = ::std::vec::Vec<U>;
+ |
warning: 9 warnings emitted
help: consider specifying the type argument in the function call
|
LL | foo::<T>(42);
- | ^^^^^
+ | +++++
error: aborting due to previous error
help: consider further restricting type parameter `T`
|
LL | trait Base<T = String>: Super<T> where T: std::marker::Copy { }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++
error[E0277]: cannot add `u8` to `i32`
--> $DIR/type-check-defaults.rs:24:66
help: you might have meant to compare for equality
|
LL | let _: bool = 0 == 0;
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:9:14
help: you might have meant to compare for equality
|
LL | 0 => 0 == 0,
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:10:14
help: you might have meant to compare for equality
|
LL | _ => 0 == 0,
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:14:17
help: you might have meant to compare for equality
|
LL | true => 0 == 0,
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:18:8
help: you might have meant to use pattern matching
|
LL | if let 0 = 0 {}
- | ^^^
+ | +++
help: you might have meant to compare for equality
|
LL | if 0 == 0 {}
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:20:24
help: you might have meant to compare for equality
|
LL | let _: bool = if { 0 == 0 } {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:21:9
help: you might have meant to compare for equality
|
LL | 0 == 0
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:23:9
help: you might have meant to compare for equality
|
LL | 0 == 0
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:26:13
help: you might have meant to compare for equality
|
LL | let _ = (0 == 0)
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:27:14
help: you might have meant to compare for equality
|
LL | && { 0 == 0 }
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-expected-bool.rs:28:12
help: you might have meant to compare for equality
|
LL | || (0 == 0);
- | ^^
+ | ~~
error[E0070]: invalid left-hand side of assignment
--> $DIR/assignment-expected-bool.rs:31:22
help: you might have meant to compare for equality
|
LL | if x == x {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:20:8
help: you might have meant to compare for equality
|
LL | if (x == x) {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:25:8
help: you might have meant to compare for equality
|
LL | if y == (Foo { foo: x }) {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:30:8
help: you might have meant to use pattern matching
|
LL | if let 3 = x {
- | ^^^
+ | +++
help: you might have meant to compare for equality
|
LL | if 3 == x {
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:36:13
help: you might have meant to compare for equality
|
LL | x == 4
- | ^^
+ | ~~
error[E0308]: mismatched types
--> $DIR/assignment-in-if.rs:38:13
help: you might have meant to compare for equality
|
LL | x == 5
- | ^^
+ | ~~
error: aborting due to 6 previous errors
help: use the tuple variant pattern syntax instead
|
LL | X::Y(number) => {}
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | fn foo<T: std::ops::Add<Output = T>>(x: T, y: T) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++
error[E0368]: binary assignment operation `+=` cannot be applied to type `T`
--> $DIR/missing_trait_impl.rs:9:5
help: consider restricting type parameter `T`
|
LL | fn bar<T: std::ops::AddAssign>(x: T) {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++
error: aborting due to 2 previous errors
help: consider further restricting `Self`
|
LL | fn test<U>(u: U) -> Self where Self: Tr<U> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error[E0277]: the trait bound `Self: Tr<U>` is not satisfied
--> $DIR/type-params-in-different-spaces-2.rs:16:9
help: consider further restricting `Self`
|
LL | fn test<U>(u: U) -> Self where Self: Tr<U> {
- | ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++
error: aborting due to 2 previous errors
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `T1` representable
|
LL | foolish: Box<T1>
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
help: try using a conversion method
|
LL | let _prove_piercing_earnest: Vec<usize> = (&[1, 2, 3]).to_vec();
- | ^ ^^^^^^^^^^
+ | + ++++++++++
error: aborting due to 4 previous errors
help: add missing generic argument
|
LL | pub fn run() -> Result<_, E> {
- | ^^^
+ | +++
error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/issue-75883.rs:15:35
help: add missing generic argument
|
LL | pub fn interact(&mut self) -> Result<_, E> {
- | ^^^
+ | +++
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/issue-75883.rs:15:42
help: consider using a semicolon here
|
LL | f(|x| match x { tmp => { g(tmp); } });
- | ^
+ | +
help: consider using a semicolon here
|
LL | f(|x| match x { tmp => { g(tmp) } };);
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/issue-81943.rs:10:38
help: consider using a semicolon here
|
LL | ($e:expr) => { match $e { x => { g(x); } } }
- | ^
+ | +
help: consider using a semicolon here
|
LL | ($e:expr) => { match $e { x => { g(x) } }; }
- | ^
+ | +
error: aborting due to 3 previous errors
help: expressions must be enclosed in braces to be used as const generic arguments
|
LL | std::<{ _ as _ }>;
- | ^ ^
+ | + +
error[E0423]: expected value, found crate `std`
--> $DIR/issue-84831.rs:2:5
--- /dev/null
+pub mod foo {
+ pub struct Foo {
+ pub you_can_use_this_field: bool,
+ you_cant_use_this_field: bool,
+ }
+}
+
+fn main() {
+ foo::Foo {};
+ //~^ ERROR cannot construct `Foo` with struct literal syntax due to inaccessible fields
+}
--- /dev/null
+error: cannot construct `Foo` with struct literal syntax due to inaccessible fields
+ --> $DIR/issue-87872-missing-inaccessible-field-literal.rs:9:5
+ |
+LL | foo::Foo {};
+ | ^^^^^^^^
+
+error: aborting due to previous error
+
--- /dev/null
+#![allow(dead_code, unused_variables)]
+
+pub mod foo {
+ #[derive(Default)]
+ pub struct Foo { pub visible: bool, invisible: bool, }
+}
+
+fn main() {
+ let foo::Foo {} = foo::Foo::default();
+ //~^ ERROR pattern does not mention field `visible` and inaccessible fields
+}
--- /dev/null
+error[E0027]: pattern does not mention field `visible` and inaccessible fields
+ --> $DIR/issue-87872-missing-inaccessible-field-pattern.rs:9:9
+ |
+LL | let foo::Foo {} = foo::Foo::default();
+ | ^^^^^^^^^^^ missing field `visible` and inaccessible fields
+ |
+help: include the missing field in the pattern and ignore the inaccessible fields
+ |
+LL | let foo::Foo { visible, .. } = foo::Foo::default();
+ | ~~~~~~~~~~~~~~~
+help: if you don't care about this missing field, you can explicitly ignore it
+ |
+LL | let foo::Foo { .. } = foo::Foo::default();
+ | ~~~~~~
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0027`.
help: consider further restricting the associated type
|
LL | fn bar<T:Trait+Send>() where <T as Trait>::AssocType: Send {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | fn foo<T: std::marker::Send>() {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
--- /dev/null
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:157:18
+ |
+LL | struct BadStruct<_>(_);
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:160:16
+ |
+LL | trait BadTrait<_> {}
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:170:19
+ |
+LL | struct BadStruct1<_, _>(_);
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:170:22
+ |
+LL | struct BadStruct1<_, _>(_);
+ | ^ expected identifier, found reserved identifier
+
+error: expected identifier, found reserved identifier `_`
+ --> $DIR/typeck_type_placeholder_item.rs:175:19
+ |
+LL | struct BadStruct2<_, T>(_, T);
+ | ^ expected identifier, found reserved identifier
+
+error: associated constant in `impl` without body
+ --> $DIR/typeck_type_placeholder_item.rs:208:5
+ |
+LL | const C: _;
+ | ^^^^^^^^^^-
+ | |
+ | help: provide a definition for the constant: `= <expr>;`
+
+error[E0403]: the name `_` is already used for a generic parameter in this item's generic parameters
+ --> $DIR/typeck_type_placeholder_item.rs:170:22
+ |
+LL | struct BadStruct1<_, _>(_);
+ | - ^ already used
+ | |
+ | first use of `_`
+
+warning: the feature `type_alias_impl_trait` is incomplete and may not be safe to use and/or cause compiler crashes
+ --> $DIR/typeck_type_placeholder_item.rs:5:32
+ |
+LL | #![cfg_attr(full_tait, feature(type_alias_impl_trait))]
+ | ^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(incomplete_features)]` on by default
+ = note: see issue #63063 <https://github.com/rust-lang/rust/issues/63063> for more information
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:10:14
+ |
+LL | fn test() -> _ { 5 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:13:16
+ |
+LL | fn test2() -> (_, _) { (5, 5) }
+ | -^--^-
+ | || |
+ | || not allowed in type signatures
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:16:15
+ |
+LL | static TEST3: _ = "test";
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `&str`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:19:15
+ |
+LL | static TEST4: _ = 145;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:22:15
+ |
+LL | static TEST5: (_, _) = (1, 2);
+ | ^^^^^^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:25:13
+ |
+LL | fn test6(_: _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test6<T>(_: T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:28:18
+ |
+LL | fn test6_b<T>(_: _, _: T) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test6_b<T, U>(_: U, _: T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:31:30
+ |
+LL | fn test6_c<T, K, L, A, B>(_: _, _: (T, K, L, A, B)) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test6_c<T, K, L, A, B, U>(_: U, _: (T, K, L, A, B)) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:34:13
+ |
+LL | fn test7(x: _) { let _x: usize = x; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test7<T>(x: T) { let _x: usize = x; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:37:22
+ |
+LL | fn test8(_f: fn() -> _) { }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: use type parameters instead: `T`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:37:22
+ |
+LL | fn test8(_f: fn() -> _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test8<T>(_f: fn() -> T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:51:26
+ |
+LL | fn test11(x: &usize) -> &_ {
+ | -^
+ | ||
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `&'static &'static usize`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:56:52
+ |
+LL | unsafe fn test12(x: *const usize) -> *const *const _ {
+ | --------------^
+ | | |
+ | | not allowed in type signatures
+ | help: replace with the correct return type: `*const *const usize`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:70:8
+ |
+LL | a: _,
+ | ^ not allowed in type signatures
+LL |
+LL | b: (_, _),
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL ~ struct Test10<T> {
+LL ~ a: T,
+LL |
+LL ~ b: (T, T),
+ |
+
+error: missing type for `static` item
+ --> $DIR/typeck_type_placeholder_item.rs:76:12
+ |
+LL | static A = 42;
+ | ^ help: provide a type for the static variable: `A: i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:78:15
+ |
+LL | static B: _ = 42;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:80:15
+ |
+LL | static C: Option<_> = Some(42);
+ | ^^^^^^^^^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:82:21
+ |
+LL | fn fn_test() -> _ { 5 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:85:23
+ |
+LL | fn fn_test2() -> (_, _) { (5, 5) }
+ | -^--^-
+ | || |
+ | || not allowed in type signatures
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:88:22
+ |
+LL | static FN_TEST3: _ = "test";
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `&str`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:91:22
+ |
+LL | static FN_TEST4: _ = 145;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for static variables
+ --> $DIR/typeck_type_placeholder_item.rs:94:22
+ |
+LL | static FN_TEST5: (_, _) = (1, 2);
+ | ^^^^^^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:97:20
+ |
+LL | fn fn_test6(_: _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test6<T>(_: T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:100:20
+ |
+LL | fn fn_test7(x: _) { let _x: usize = x; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:103:29
+ |
+LL | fn fn_test8(_f: fn() -> _) { }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: use type parameters instead: `T`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:103:29
+ |
+LL | fn fn_test8(_f: fn() -> _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test8<T>(_f: fn() -> T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:126:12
+ |
+LL | a: _,
+ | ^ not allowed in type signatures
+LL |
+LL | b: (_, _),
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL ~ struct FnTest10<T> {
+LL ~ a: T,
+LL |
+LL ~ b: (T, T),
+ |
+
+error[E0282]: type annotations needed
+ --> $DIR/typeck_type_placeholder_item.rs:131:18
+ |
+LL | fn fn_test11(_: _) -> (_, _) { panic!() }
+ | ^ cannot infer type
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:131:28
+ |
+LL | fn fn_test11(_: _) -> (_, _) { panic!() }
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:135:30
+ |
+LL | fn fn_test12(x: i32) -> (_, _) { (x, x) }
+ | -^--^-
+ | || |
+ | || not allowed in type signatures
+ | |not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:138:33
+ |
+LL | fn fn_test13(x: _) -> (i32, _) { (x, x) }
+ | ------^-
+ | | |
+ | | not allowed in type signatures
+ | help: replace with the correct return type: `(i32, i32)`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:157:21
+ |
+LL | struct BadStruct<_>(_);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | struct BadStruct<T>(T);
+ | ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for implementations
+ --> $DIR/typeck_type_placeholder_item.rs:162:15
+ |
+LL | impl BadTrait<_> for BadStruct<_> {}
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | impl<T> BadTrait<T> for BadStruct<T> {}
+ | +++ ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
+ --> $DIR/typeck_type_placeholder_item.rs:165:34
+ |
+LL | fn impl_trait() -> impl BadTrait<_> {
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:170:25
+ |
+LL | struct BadStruct1<_, _>(_);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | struct BadStruct1<T, _>(T);
+ | ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
+ --> $DIR/typeck_type_placeholder_item.rs:175:25
+ |
+LL | struct BadStruct2<_, T>(_, T);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | struct BadStruct2<U, T>(U, T);
+ | ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for type aliases
+ --> $DIR/typeck_type_placeholder_item.rs:179:14
+ |
+LL | type X = Box<_>;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
+ --> $DIR/typeck_type_placeholder_item.rs:185:21
+ |
+LL | type Y = impl Trait<_>;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:219:31
+ |
+LL | fn value() -> Option<&'static _> {
+ | ----------------^-
+ | | |
+ | | not allowed in type signatures
+ | help: replace with the correct return type: `Option<&'static u8>`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:224:10
+ |
+LL | const _: Option<_> = map(value);
+ | ^^^^^^^^^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `Option<u8>`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:143:31
+ |
+LL | fn method_test1(&self, x: _);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn method_test1<T>(&self, x: T);
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:145:31
+ |
+LL | fn method_test2(&self, x: _) -> _;
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn method_test2<T>(&self, x: T) -> T;
+ | +++ ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:147:31
+ |
+LL | fn method_test3(&self) -> _;
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn method_test3<T>(&self) -> T;
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:149:26
+ |
+LL | fn assoc_fn_test1(x: _);
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn assoc_fn_test1<T>(x: T);
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:151:26
+ |
+LL | fn assoc_fn_test2(x: _) -> _;
+ | ^ ^ not allowed in type signatures
+ | |
+ | not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn assoc_fn_test2<T>(x: T) -> T;
+ | +++ ~ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:153:28
+ |
+LL | fn assoc_fn_test3() -> _;
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn assoc_fn_test3<T>() -> T;
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:193:14
+ |
+LL | type B = _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:195:14
+ |
+LL | const C: _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:197:14
+ |
+LL | const D: _ = 42;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:200:26
+ |
+LL | type F: std::ops::Fn(_);
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:44:24
+ |
+LL | fn test9(&self) -> _ { () }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `()`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:47:27
+ |
+LL | fn test10(&self, _x : _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn test10<T>(&self, _x : T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:62:24
+ |
+LL | fn clone(&self) -> _ { Test9 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `Test9`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:65:37
+ |
+LL | fn clone_from(&mut self, other: _) { *self = Test9; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:110:31
+ |
+LL | fn fn_test9(&self) -> _ { () }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `()`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:113:34
+ |
+LL | fn fn_test10(&self, _x : _) { }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn fn_test10<T>(&self, _x : T) { }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
+ --> $DIR/typeck_type_placeholder_item.rs:118:28
+ |
+LL | fn clone(&self) -> _ { FnTest9 }
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct return type: `FnTest9`
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
+ --> $DIR/typeck_type_placeholder_item.rs:121:41
+ |
+LL | fn clone_from(&mut self, other: _) { *self = FnTest9; }
+ | ^ not allowed in type signatures
+ |
+help: use type parameters instead
+ |
+LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
+ | +++ ~
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:204:14
+ |
+LL | type A = _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
+ --> $DIR/typeck_type_placeholder_item.rs:206:14
+ |
+LL | type B = _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:208:14
+ |
+LL | const C: _;
+ | ^ not allowed in type signatures
+
+error[E0121]: the type placeholder `_` is not allowed within types on item signatures for constants
+ --> $DIR/typeck_type_placeholder_item.rs:211:14
+ |
+LL | const D: _ = 42;
+ | ^
+ | |
+ | not allowed in type signatures
+ | help: replace with the correct type: `i32`
+
+error: aborting due to 69 previous errors; 1 warning emitted
+
+Some errors have detailed explanations: E0121, E0282, E0403.
+For more information about an error, try `rustc --explain E0121`.
help: use type parameters instead
|
LL | fn test6<T>(_: T) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:25:18
help: use type parameters instead
|
LL | fn test6_b<T, U>(_: U, _: T) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:28:30
help: use type parameters instead
|
LL | fn test6_c<T, K, L, A, B, U>(_: U, _: (T, K, L, A, B)) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:31:13
help: use type parameters instead
|
LL | fn test7<T>(x: T) { let _x: usize = x; }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:34:22
help: use type parameters instead
|
LL | fn test8<T>(_f: fn() -> T) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/typeck_type_placeholder_item.rs:48:26
|
help: use type parameters instead
|
-LL | struct Test10<T> {
-LL | a: T,
+LL ~ struct Test10<T> {
+LL ~ a: T,
LL |
-LL | b: (T, T),
+LL ~ b: (T, T),
|
error: missing type for `static` item
help: use type parameters instead
|
LL | fn fn_test6<T>(_: T) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:97:20
help: use type parameters instead
|
LL | fn fn_test7<T>(x: T) { let _x: usize = x; }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:100:29
help: use type parameters instead
|
LL | fn fn_test8<T>(_f: fn() -> T) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
--> $DIR/typeck_type_placeholder_item.rs:123:12
|
help: use type parameters instead
|
-LL | struct FnTest10<T> {
-LL | a: T,
+LL ~ struct FnTest10<T> {
+LL ~ a: T,
LL |
-LL | b: (T, T),
+LL ~ b: (T, T),
|
error[E0282]: type annotations needed
help: use type parameters instead
|
LL | struct BadStruct<T>(T);
- | ^ ^
+ | ~ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for implementations
--> $DIR/typeck_type_placeholder_item.rs:159:15
help: use type parameters instead
|
LL | impl<T> BadTrait<T> for BadStruct<T> {}
- | ^^^ ^ ^
+ | +++ ~ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for opaque types
--> $DIR/typeck_type_placeholder_item.rs:162:34
help: use type parameters instead
|
LL | struct BadStruct1<T, _>(T);
- | ^ ^
+ | ~ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for structs
--> $DIR/typeck_type_placeholder_item.rs:172:25
help: use type parameters instead
|
LL | struct BadStruct2<U, T>(U, T);
- | ^ ^
+ | ~ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for type aliases
--> $DIR/typeck_type_placeholder_item.rs:176:14
help: use type parameters instead
|
LL | fn method_test1<T>(&self, x: T);
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:142:31
help: use type parameters instead
|
LL | fn method_test2<T>(&self, x: T) -> T;
- | ^^^ ^ ^
+ | +++ ~ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:144:31
help: use type parameters instead
|
LL | fn method_test3<T>(&self) -> T;
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:146:26
help: use type parameters instead
|
LL | fn assoc_fn_test1<T>(x: T);
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:148:26
help: use type parameters instead
|
LL | fn assoc_fn_test2<T>(x: T) -> T;
- | ^^^ ^ ^
+ | +++ ~ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for functions
--> $DIR/typeck_type_placeholder_item.rs:150:28
help: use type parameters instead
|
LL | fn assoc_fn_test3<T>() -> T;
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
--> $DIR/typeck_type_placeholder_item.rs:190:14
help: use type parameters instead
|
LL | fn test10<T>(&self, _x : T) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/typeck_type_placeholder_item.rs:59:24
help: use type parameters instead
|
LL | fn clone_from<T>(&mut self, other: T) { *self = Test9; }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/typeck_type_placeholder_item.rs:107:31
help: use type parameters instead
|
LL | fn fn_test10<T>(&self, _x : T) { }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for return types
--> $DIR/typeck_type_placeholder_item.rs:115:28
help: use type parameters instead
|
LL | fn clone_from<T>(&mut self, other: T) { *self = FnTest9; }
- | ^^^ ^
+ | +++ ~
error[E0121]: the type placeholder `_` is not allowed within types on item signatures for associated types
--> $DIR/typeck_type_placeholder_item.rs:201:14
help: change the type of the numeric literal from `i8` to `u8`
|
LL | let b: typeof(a) = 1u8;
- | ^^^
+ | ~~~
error: aborting due to 2 previous errors
help: add missing generic argument
|
LL | <String as IntoCow<B>>::into_cow("foo".to_string());
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0107]: missing generics for trait `IntoCow`
--> $DIR/ufcs-qpath-missing-params.rs:17:16
help: add missing generic argument
|
LL | <String as IntoCow<B>>::into_cow::<str>("foo".to_string());
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/ufcs-qpath-missing-params.rs:17:26
help: change the type of the numeric literal from `u32` to `i32`
|
LL | <i32 as Add<i32>>::add(1i32, 2);
- | ^^^^
+ | ~~~~
error[E0308]: mismatched types
--> $DIR/ufcs-qpath-self-mismatch.rs:8:31
help: change the type of the numeric literal from `u32` to `i32`
|
LL | <i32 as Add<i32>>::add(1, 2i32);
- | ^^^^
+ | ~~~~
error: aborting due to 3 previous errors
help: consider further restricting the associated type
|
LL | fn main() where <() as Lt<'_>>::T: Sized {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | let f: &mut dyn FnMut<(_,), Output = ()> = &mut |_: &<() as Lt<'_>>::T| {};
- | ^
+ | +
error: aborting due to previous error
= help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from argument 1 or argument 2
help: consider introducing a named lifetime parameter
|
-LL | fn main<'a>() {
+LL ~ fn main<'a>() {
LL | eq::< dyn for<'a> Foo<(&'a isize,), Output=&'a isize>,
LL | dyn Foo(&isize) -> &isize >();
LL | eq::< dyn for<'a> Foo<(&'a isize,), Output=(&'a isize, &'a isize)>,
help: add missing generic argument
|
LL | let x: Box<Bar(A)> = panic!();
- | ^
+ | +
error: aborting due to 2 previous errors
help: add missing generic argument
|
LL | fn foo(b: Box<Bar(A)>) {
- | ^
+ | +
error: aborting due to 2 previous errors
help: change the type of the numeric literal from `usize` to `isize`
|
LL | let z = f(1_isize, 2);
- | ^^^^^^^
+ | ~~~~~~~
error: aborting due to previous error
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: Box<dyn Debug + 'a>,
+LL ~ struct Foo<'a> {
+LL ~ x: Box<dyn Debug + 'a>,
|
error[E0228]: the lifetime bound for this object type cannot be deduced from context; please supply an explicit bound
help: to declare that the trait object captures data from argument `items`, you can add an explicit `'_` lifetime bound
|
LL | fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T> + '_> {
- | ^^^^
+ | ++++
error: aborting due to previous error
help: consider introducing a named lifetime parameter
|
LL | fn foo<'a>(x: &'a u32, y: &'a u32) -> &'a u32 { loop { } }
- | ^^^^ ^^^^^^^ ^^^^^^^ ^^
+ | ++++ ~~~~~~~ ~~~~~~~ ~~
error: aborting due to previous error
|
help: consider introducing a named lifetime parameter
|
-LL | struct Foo<'a> {
-LL | x: &'a u32,
+LL ~ struct Foo<'a> {
+LL ~ x: &'a u32,
|
error[E0106]: missing lifetime specifier
|
help: consider introducing a named lifetime parameter
|
-LL | enum Bar<'a> {
-LL | Variant(&'a u32),
+LL ~ enum Bar<'a> {
+LL ~ Variant(&'a u32),
|
error: aborting due to 2 previous errors
help: consider using the `'a` lifetime
|
LL | struct Baz<'a>(&'a &'a u8);
- | ^^
+ | ~~
error[E0106]: missing lifetime specifier
--> $DIR/underscore-lifetime-binders.rs:10:33
help: consider using the `'static` lifetime
|
LL | fn meh() -> Box<dyn for<'_> Meh<'static>>
- | ^^^^^^^
+ | ~~~~~~~
error[E0106]: missing lifetime specifier
--> $DIR/underscore-lifetime-binders.rs:16:35
help: consider introducing a named lifetime parameter
|
LL | fn foo2<'a>(_: &'a u8, y: &'a u8) -> &'a u8 { y }
- | ^^^^ ^^^^^^ ^^^^^^ ^^
+ | ++++ ~~~~~~ ~~~~~~ ~~
error: aborting due to 5 previous errors
help: you might want to use `if let` to ignore the variant that isn't matched
|
LL | if let Foo::D(_y) = x { /* */ }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `U` representable
|
LL | b: Box<U>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to previous error
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | union Foo<T> {
- | --
+LL - union Foo<T: ?Sized> {
+LL + union Foo<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:9:12
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | struct Foo2<T> {
- | --
+LL - struct Foo2<T: ?Sized> {
+LL + struct Foo2<T> {
+ |
help: borrowed types always have a statically known size
|
LL | value: &T,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | value: Box<T>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/union-sized-field.rs:15:11
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | enum Foo3<T> {
- | --
+LL - enum Foo3<T: ?Sized> {
+LL + enum Foo3<T> {
+ |
help: borrowed types always have a statically known size
|
LL | Value(&T),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | Value(Box<T>),
- | ^^^^ ^
+ | ++++ +
error: aborting due to 3 previous errors
help: use parentheses to call the method
|
LL | let y = u.calculate();
- | ^^
+ | ++
error: aborting due to 3 previous errors
help: use parentheses to call the method
|
LL | let y = u.calculate();
- | ^^
+ | ++
error: aborting due to 3 previous errors
help: borrowed types always have a statically known size
|
LL | a: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | a: Box<str>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/union-unsized.rs:15:8
help: borrowed types always have a statically known size
|
LL | b: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | b: Box<str>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
help: borrowed types always have a statically known size
|
LL | a: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | a: Box<str>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/union-unsized.rs:15:8
help: borrowed types always have a statically known size
|
LL | b: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | b: Box<str>,
- | ^^^^ ^
+ | ++++ +
error: aborting due to 2 previous errors
help: consider further restricting this bound
|
LL | fn move_then_borrow<T: Not<Output=T> + Clone + Copy>(x: T) {
- | ^^^^^^
+ | ++++++
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/unop-move-semantics.rs:15:6
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn foo<T>() { bar::<T>() }
- | --
+LL - fn foo<T: ?Sized>() { bar::<T>() }
+LL + fn foo<T>() { bar::<T>() }
+ |
error: aborting due to previous error
| this could be changed to `U: ?Sized`...
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn foo2<T>() { not_sized::<Foo<T>>() }
- | --
+LL - fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
+LL + fn foo2<T>() { not_sized::<Foo<T>>() }
+ |
error: aborting due to previous error
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | enum E<W, X: ?Sized, Y: ?Sized, Z: ?Sized> {
- | --
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+ |
help: borrowed types always have a statically known size
|
LL | VA(&W),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VA(Box<W>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:25:11
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | enum E<W: ?Sized, X, Y: ?Sized, Z: ?Sized> {
- | --
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W: ?Sized, X, Y: ?Sized, Z: ?Sized> {
+ |
help: borrowed types always have a statically known size
|
LL | VB{x: &X},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VB{x: Box<X>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `Y` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:27:15
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | enum E<W: ?Sized, X: ?Sized, Y, Z: ?Sized> {
- | --
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W: ?Sized, X: ?Sized, Y, Z: ?Sized> {
+ |
help: borrowed types always have a statically known size
|
LL | VC(isize, &Y),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VC(isize, Box<Y>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `Z` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:29:21
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z> {
- | --
+LL - enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {
+LL + enum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z> {
+ |
help: borrowed types always have a statically known size
|
LL | VD{u: isize, x: &Z},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VD{u: isize, x: Box<Z>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:33:8
help: borrowed types always have a statically known size
|
LL | VE(&[u8]),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VE(Box<[u8]>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:35:11
help: borrowed types always have a statically known size
|
LL | VF{x: &str},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VF{x: Box<str>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[f32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:37:15
help: borrowed types always have a statically known size
|
LL | VG(isize, &[f32]),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VG(isize, Box<[f32]>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[u32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:39:21
help: borrowed types always have a statically known size
|
LL | VH{u: isize, x: &[u32]},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VH{u: isize, x: Box<[u32]>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:53:8
help: borrowed types always have a statically known size
|
LL | VM(&dyn Foo),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VM(Box<dyn Foo>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn Bar + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:55:11
help: borrowed types always have a statically known size
|
LL | VN{x: &dyn Bar},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VN{x: Box<dyn Bar>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn FooBar + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:57:15
help: borrowed types always have a statically known size
|
LL | VO(isize, &dyn FooBar),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VO(isize, Box<dyn FooBar>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn BarFoo + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:59:21
help: borrowed types always have a statically known size
|
LL | VP{u: isize, x: &dyn BarFoo},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VP{u: isize, x: Box<dyn BarFoo>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[i8]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:63:8
help: borrowed types always have a statically known size
|
LL | VQ(&<&'static [i8] as Deref>::Target),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VQ(Box<<&'static [i8] as Deref>::Target>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[char]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:65:11
help: borrowed types always have a statically known size
|
LL | VR{x: &<&'static [char] as Deref>::Target},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VR{x: Box<<&'static [char] as Deref>::Target>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[f64]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:67:15
help: borrowed types always have a statically known size
|
LL | VS(isize, &<&'static [f64] as Deref>::Target),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VS(isize, Box<<&'static [f64] as Deref>::Target>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:69:21
help: borrowed types always have a statically known size
|
LL | VT{u: isize, x: &<&'static [i32] as Deref>::Target},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:43:8
help: borrowed types always have a statically known size
|
LL | VI(&Path1),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VI(Box<Path1>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:45:11
help: borrowed types always have a statically known size
|
LL | VJ{x: &Path2},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VJ{x: Box<Path2>},
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:47:15
help: borrowed types always have a statically known size
|
LL | VK(isize, &Path3),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VK(isize, Box<Path3>),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time
--> $DIR/unsized-enum2.rs:49:21
help: borrowed types always have a statically known size
|
LL | VL{u: isize, x: &Path4},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | VL{u: isize, x: Box<Path4>},
- | ^^^^ ^
+ | ++++ +
error: aborting due to 20 previous errors
= help: unsized fn params are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f<T>(t: T) {}
- | --
+LL - fn f<T: ?Sized>(t: T) {}
+LL + fn f<T>(t: T) {}
+ |
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn f<T: ?Sized>(t: &T) {}
- | ^
+ | +
error: aborting due to previous error
| this could be changed to `Y: ?Sized`...
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X> S5<X> {
- | --
+LL - impl<X: ?Sized> S5<X> {
+LL + impl<X> S5<X> {
+ |
error: aborting due to previous error
| this could be changed to `T: ?Sized`...
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn foo2<T>() { not_sized::<Foo<T>>() }
- | --
+LL - fn foo2<T: ?Sized>() { not_sized::<Foo<T>>() }
+LL + fn foo2<T>() { not_sized::<Foo<T>>() }
+ |
error[E0277]: the size for values of type `T` cannot be known at compilation time
--> $DIR/unsized-struct.rs:13:24
| ^^^
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn bar2<T>() { is_sized::<Bar<T>>() }
- | --
+LL - fn bar2<T: ?Sized>() { is_sized::<Bar<T>>() }
+LL + fn bar2<T>() { is_sized::<Bar<T>>() }
+ |
error: aborting due to 2 previous errors
| this could be changed to `Y: ?Sized`...
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X> T3<X> for S5<X> {
- | --
+LL - impl<X: ?Sized> T3<X> for S5<X> {
+LL + impl<X> T3<X> for S5<X> {
+ |
error: aborting due to previous error
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X> T2<X> for S4<X> {
- | --
+LL - impl<X: ?Sized> T2<X> for S4<X> {
+LL + impl<X> T2<X> for S4<X> {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait T2<Z: ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f1<X>(x: &X) {
- | --
+LL - fn f1<X: ?Sized>(x: &X) {
+LL + fn f1<X>(x: &X) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f2<X: ?Sized>(x: &X) {
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:18:13
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f3<X: T>(x: &X) {
- | --
+LL - fn f3<X: ?Sized + T>(x: &X) {
+LL + fn f3<X: T>(x: &X) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f4<X: T + ?Sized>(x: &X) {
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:33:8
| ^
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f8<X>(x1: &S<X>, x2: &S<X>) {
- | --
+LL - fn f8<X: ?Sized>(x1: &S<X>, x2: &S<X>) {
+LL + fn f8<X>(x1: &S<X>, x2: &S<X>) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f5<Y: ?Sized>(x: &Y) {}
- | ^^^^^^^^
+ | ++++++++
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:40:8
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f9<X>(x1: Box<S<X>>) {
- | --
+LL - fn f9<X: ?Sized>(x1: Box<S<X>>) {
+LL + fn f9<X>(x1: Box<S<X>>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:45:9
= note: tuples must have a statically known size to be initialized
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f10<X>(x1: Box<S<X>>) {
- | --
+LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
+LL + fn f10<X>(x1: Box<S<X>>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized3.rs:45:8
= note: required because it appears within the type `({integer}, S<X>)`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f10<X>(x1: Box<S<X>>) {
- | --
+LL - fn f10<X: ?Sized>(x1: Box<S<X>>) {
+LL + fn f10<X>(x1: Box<S<X>>) {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | fn f5<Y: ?Sized>(x: &Y) {}
- | ^^^^^^^^
+ | ++++++++
error: aborting due to 6 previous errors
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | struct S1<X> {
- | --
+LL - struct S1<X: ?Sized> {
+LL + struct S1<X> {
+ |
help: borrowed types always have a statically known size
|
LL | f1: &X,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | f1: Box<X>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized5.rs:10:8
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | struct S2<X> {
- | --
+LL - struct S2<X: ?Sized> {
+LL + struct S2<X> {
+ |
help: borrowed types always have a statically known size
|
LL | g: &X,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | g: Box<X>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `str` cannot be known at compilation time
--> $DIR/unsized5.rs:15:8
help: borrowed types always have a statically known size
|
LL | f: &str,
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | f: Box<str>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/unsized5.rs:20:8
help: borrowed types always have a statically known size
|
LL | f: &[u8],
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | f: Box<[u8]>,
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized5.rs:25:8
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | enum E<X> {
- | --
+LL - enum E<X: ?Sized> {
+LL + enum E<X> {
+ |
help: borrowed types always have a statically known size
|
LL | V1(&X, isize),
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | V1(Box<X>, isize),
- | ^^^^ ^
+ | ++++ +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized5.rs:29:12
= help: change the field's type to have a statically known size
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | enum F<X> {
- | --
+LL - enum F<X: ?Sized> {
+LL + enum F<X> {
+ |
help: borrowed types always have a statically known size
|
LL | V2{f1: &X, f: isize},
- | ^
+ | +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | V2{f1: Box<X>, f: isize},
- | ^^^^ ^
+ | ++++ +
error: aborting due to 6 previous errors
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f1<W: ?Sized, X: ?Sized, Y, Z: ?Sized>(x: &X) {
- | --
+LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
+LL + fn f1<W: ?Sized, X: ?Sized, Y, Z: ?Sized>(x: &X) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:7:12
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f1<W: ?Sized, X, Y: ?Sized, Z: ?Sized>(x: &X) {
- | --
+LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
+LL + fn f1<W: ?Sized, X, Y: ?Sized, Z: ?Sized>(x: &X) {
+ |
error[E0277]: the size for values of type `Z` cannot be known at compilation time
--> $DIR/unsized6.rs:11:12
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z>(x: &X) {
- | --
+LL - fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized>(x: &X) {
+LL + fn f1<W: ?Sized, X: ?Sized, Y: ?Sized, Z>(x: &X) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:15:9
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f2<X, Y: ?Sized>(x: &X) {
- | --
+LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
+LL + fn f2<X, Y: ?Sized>(x: &X) {
+ |
error[E0277]: the size for values of type `Y` cannot be known at compilation time
--> $DIR/unsized6.rs:17:12
= note: only the last element of a tuple may have a dynamically sized type
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f2<X: ?Sized, Y>(x: &X) {
- | --
+LL - fn f2<X: ?Sized, Y: ?Sized>(x: &X) {
+LL + fn f2<X: ?Sized, Y>(x: &X) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:22:9
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | --
+LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:24:9
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | --
+LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:26:10
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | --
+LL - fn f3<X: ?Sized>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f3<X>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:30:9
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | --
+LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:32:9
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | --
+LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:34:10
= help: unsized locals are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
- | --
+LL - fn f4<X: ?Sized + T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+LL + fn f4<X: T>(x1: Box<X>, x2: Box<X>, x3: Box<X>) {
+ |
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:38:18
= help: unsized fn params are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn g1<X>(x: X) {}
- | --
+LL - fn g1<X: ?Sized>(x: X) {}
+LL + fn g1<X>(x: X) {}
+ |
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn g1<X: ?Sized>(x: &X) {}
- | ^
+ | +
error[E0277]: the size for values of type `X` cannot be known at compilation time
--> $DIR/unsized6.rs:40:22
= help: unsized fn params are gated as an unstable feature
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | fn g2<X: T>(x: X) {}
- | --
+LL - fn g2<X: ?Sized + T>(x: X) {}
+LL + fn g2<X: T>(x: X) {}
+ |
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn g2<X: ?Sized + T>(x: &X) {}
- | ^
+ | +
error: aborting due to 13 previous errors
|
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
-LL | impl<X: T> T1<X> for S3<X> {
- | --
+LL - impl<X: ?Sized + T> T1<X> for S3<X> {
+LL + impl<X: T> T1<X> for S3<X> {
+ |
help: consider relaxing the implicit `Sized` restriction
|
LL | trait T1<Z: T + ?Sized> {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
|
help: consider importing the module directly
|
-LL | use foo;
- | --
+LL - use foo::self;
+LL + use foo;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::{self};
- | ^ ^
+ | + +
error[E0429]: `self` imports are only allowed within a { } list
--> $DIR/use-mod-4.rs:4:13
|
help: consider importing the module directly
|
-LL | use std::mem;
- | --
+LL - use std::mem::self;
+LL + use std::mem;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use std::mem::{self};
- | ^ ^
+ | + +
error[E0432]: unresolved import `foo`
--> $DIR/use-mod-4.rs:1:5
|
help: consider importing the module directly
|
-LL | use foo::bar;
- | --
+LL - use foo::bar::self;
+LL + use foo::bar;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::bar::{self};
- | ^ ^
+ | + +
error: aborting due to previous error
|
help: consider importing the module directly
|
-LL | use foo::bar as abc;
- | --
+LL - use foo::bar::self as abc;
+LL + use foo::bar as abc;
+ |
help: alternatively, use the multi-path `use` syntax to import `self`
|
LL | use foo::bar::{self as abc};
- | ^ ^
+ | + +
error: aborting due to previous error
help: you can use `as` to change the binding name of the import
|
LL | pub use variant_namespacing::XE::{XStruct as OtherXStruct, XTuple, XUnit};
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `XTuple` is defined multiple times
--> $DIR/variant-namespacing.rs:24:44
help: you can use `as` to change the binding name of the import
|
LL | pub use variant_namespacing::XE::{XStruct, XTuple as OtherXTuple, XUnit};
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `XUnit` is defined multiple times
--> $DIR/variant-namespacing.rs:24:52
help: you can use `as` to change the binding name of the import
|
LL | pub use variant_namespacing::XE::{XStruct, XTuple, XUnit as OtherXUnit};
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Struct` is defined multiple times
--> $DIR/variant-namespacing.rs:28:13
help: you can use `as` to change the binding name of the import
|
LL | pub use E::{Struct as OtherStruct, Tuple, Unit};
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Tuple` is defined multiple times
--> $DIR/variant-namespacing.rs:28:21
help: you can use `as` to change the binding name of the import
|
LL | pub use E::{Struct, Tuple as OtherTuple, Unit};
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error[E0255]: the name `Unit` is defined multiple times
--> $DIR/variant-namespacing.rs:28:28
help: you can use `as` to change the binding name of the import
|
LL | pub use E::{Struct, Tuple, Unit as OtherUnit};
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
help: try using the variant's enum
|
LL | B(E),
- | ^
+ | ~
LL | B(Ty),
- | ^^
+ | ~~
error[E0573]: expected type, found variant `E::A`
--> $DIR/variant-used-as-type.rs:17:6
help: try using the variant's enum
|
LL | impl E {}
- | ^
+ | ~
LL | impl Ty {}
- | ^^
+ | ~~
error: aborting due to 2 previous errors
--- /dev/null
+// Regression test for #87549.
+// compile-flags: -C incremental=tmp/wf/hir-wf-check-erase-regions
+
+pub struct Table<T, const N: usize>([Option<T>; N]);
+
+impl<'a, T, const N: usize> IntoIterator for &'a Table<T, N> {
+ type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>; //~ ERROR `&T` is not an iterator
+ type Item = &'a T;
+
+ fn into_iter(self) -> Self::IntoIter { //~ ERROR `&T` is not an iterator
+ unimplemented!()
+ }
+}
+fn main() {}
--- /dev/null
+error[E0277]: `&T` is not an iterator
+ --> $DIR/hir-wf-check-erase-regions.rs:7:21
+ |
+LL | type IntoIter = std::iter::Flatten<std::slice::Iter<'a, T>>;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&T` is not an iterator
+ |
+ ::: $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
+ |
+LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
+ | ------------ required by this bound in `Flatten`
+ |
+ = help: the trait `Iterator` is not implemented for `&T`
+ = note: required because of the requirements on the impl of `IntoIterator` for `&T`
+
+error[E0277]: `&T` is not an iterator
+ --> $DIR/hir-wf-check-erase-regions.rs:10:27
+ |
+LL | fn into_iter(self) -> Self::IntoIter {
+ | ^^^^^^^^^^^^^^ `&T` is not an iterator
+ |
+ ::: $SRC_DIR/core/src/iter/adapters/flatten.rs:LL:COL
+ |
+LL | pub struct Flatten<I: Iterator<Item: IntoIterator>> {
+ | ------------ required by this bound in `Flatten`
+ |
+ = help: the trait `Iterator` is not implemented for `&T`
+ = note: required because of the requirements on the impl of `IntoIterator` for `&T`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
help: consider further restricting type parameter `U`
|
LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `A`
|
LL | enum AnotherEnum<A: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `A`
|
LL | enum SomeEnum<A: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider further restricting type parameter `U`
|
LL | fn foo<T,U>() where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time
--> $DIR/wf-fn-where-clause.rs:12:16
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-impl-associated-type-region.rs:10:5
+ --> $DIR/wf-impl-associated-type-region.rs:10:16
|
LL | impl<'a, T> Foo<'a> for T {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Bar = &'a T;
- | ^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
+ | ^^^^^ ...so that the reference type `&'a T` does not outlive the data it points at
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: MyHash> Foo for T {
- | ^^^^^^^^
+ | ++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | fn bar<T: std::marker::Copy>(_: &MustBeCopy<T>)
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | fn bar<T: std::marker::Copy>() -> MustBeCopy<T>
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | struct Bar<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | struct Foo<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider further restricting type parameter `U`
|
LL | where T: MustBeCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | struct Bar<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `U`
|
LL | impl<T,U: std::marker::Copy> Foo<T,U> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider further restricting type parameter `U`
|
LL | impl<T,U> Foo<T,U> where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:5
+ --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:16
|
LL | impl<'a, T> Trait<'a, T> for usize {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = &'a fn(T);
- | ^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a fn(T)` does not outlive the data it points at
+ | ^^^^^^^^^ ...so that the reference type `&'a fn(T)` does not outlive the data it points at
error[E0309]: the parameter type `T` may not live long enough
- --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
+ --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:16
|
LL | impl<'a, T> Trait<'a, T> for u32 {
| - help: consider adding an explicit lifetime bound...: `T: 'a`
LL | type Out = &'a dyn Baz<T>;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
+ | ^^^^^^^^^^^^^^ ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
error: aborting due to 2 previous errors
help: consider further restricting type parameter `U`
|
LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `A`
|
LL | struct SomeStruct<A: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | trait SomeTrait<T: std::marker::Copy> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
error[E0309]: the associated type `<Self as SomeTrait<'a>>::Type1` may not live long enough
- --> $DIR/wf-trait-associated-type-region.rs:9:5
+ --> $DIR/wf-trait-associated-type-region.rs:9:18
|
LL | type Type2 = &'a Self::Type1;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ^^^^^^^^^^^^^^^
|
= help: consider adding an explicit lifetime bound `<Self as SomeTrait<'a>>::Type1: 'a`...
= note: ...so that the reference type `&'a <Self as SomeTrait<'a>>::Type1` does not outlive the data it points at
help: consider further restricting the associated type
|
LL | trait SomeTrait where <Self as SomeTrait>::Type1: Copy {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++++++++++++++++++
error: aborting due to previous error
help: consider further restricting type parameter `U`
|
LL | where T: ExtraCopy<U>, U: std::marker::Copy
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ++++++++++++++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn bar(&self, x: &Bar<Self>) where Self: Eq {
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn bar(&self) -> Bar<Self> where Self: Eq {
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn bar<A>(&self) where A: Bar<Self>, Self: Eq {
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn bar(&self, x: &Bar<Self>) where Self: Eq;
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn bar(&self) -> &Bar<Self> where Self: Eq;
- | ^^^^^^^^^^^^^^
+ | ++++++++++++++
error: aborting due to previous error
help: consider further restricting `Self`
|
LL | fn bar(&self) where Self: Sized, Bar<Self>: Copy, Self: Eq;
- | ^^^^^^^^^^
+ | ++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | trait SomeTrait<T: std::marker::Copy>: ExtraCopy<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Foo<T> for Bar<T> {
- | ^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++
error: aborting due to previous error
help: you can convert an `isize` to a `usize` and panic if the converted value doesn't fit
|
LL | fn mk_int() -> usize { let i: isize = 3; return i.try_into().unwrap(); }
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
-Subproject commit cc17afbb0067b1f57d8882640f63b2168d5b7624
+Subproject commit b51439fd8b505d4800a257acfecf3c69f81e35cf
help: did you mean `a = a + 1` or `a = a + a + 1`? Consider replacing it with
|
LL | a += 1;
- | ^^^^^^
+ | ~~~~~~
help: or
|
LL | a = a + a + 1;
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:6:5
help: did you mean `a = a + 1` or `a = a + 1 + a`? Consider replacing it with
|
LL | a += 1;
- | ^^^^^^
+ | ~~~~~~
help: or
|
LL | a = a + 1 + a;
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:7:5
help: did you mean `a = a - 1` or `a = a - (a - 1)`? Consider replacing it with
|
LL | a -= 1;
- | ^^^^^^
+ | ~~~~~~
help: or
|
LL | a = a - (a - 1);
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:8:5
help: did you mean `a = a * 99` or `a = a * a * 99`? Consider replacing it with
|
LL | a *= 99;
- | ^^^^^^^
+ | ~~~~~~~
help: or
|
LL | a = a * a * 99;
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:9:5
help: did you mean `a = a * 42` or `a = a * 42 * a`? Consider replacing it with
|
LL | a *= 42;
- | ^^^^^^^
+ | ~~~~~~~
help: or
|
LL | a = a * 42 * a;
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:10:5
help: did you mean `a = a / 2` or `a = a / (a / 2)`? Consider replacing it with
|
LL | a /= 2;
- | ^^^^^^
+ | ~~~~~~
help: or
|
LL | a = a / (a / 2);
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:11:5
help: did you mean `a = a % 5` or `a = a % (a % 5)`? Consider replacing it with
|
LL | a %= 5;
- | ^^^^^^
+ | ~~~~~~
help: or
|
LL | a = a % (a % 5);
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:12:5
help: did you mean `a = a & 1` or `a = a & a & 1`? Consider replacing it with
|
LL | a &= 1;
- | ^^^^^^
+ | ~~~~~~
help: or
|
LL | a = a & a & 1;
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: variable appears on both sides of an assignment operation
--> $DIR/assign_ops2.rs:13:5
help: did you mean `a = a * a` or `a = a * a * a`? Consider replacing it with
|
LL | a *= a;
- | ^^^^^^
+ | ~~~~~~
help: or
|
LL | a = a * a * a;
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: manual implementation of an assign operation
--> $DIR/assign_ops2.rs:50:5
= note: `-D clippy::async-yields-async` implied by `-D warnings`
help: consider awaiting this value
|
-LL | async {
-LL | 3
-LL | }.await
+LL ~ async {
+LL + 3
+LL + }.await
|
error: an async construct yields a type which is itself awaitable
|
help: consider awaiting this value
|
-LL | async {
-LL | 3
-LL | }.await
+LL ~ async {
+LL + 3
+LL + }.await
|
error: an async construct yields a type which is itself awaitable
help: try this
|
LL | let _ = Some("42").map(|s| if s.len() < 42 { 0 } else { s.len() });
- | ^^^ ^ ^^^^^^^
+ | ~~~ ~ ~~~~~~~
error: using `Result.and_then(|x| Ok(y))`, which is more succinctly expressed as `map(|x| y)`
--> $DIR/bind_instead_of_map_multipart.rs:8:13
help: try this
|
LL | let _ = Ok::<_, ()>("42").map(|s| if s.len() < 42 { 0 } else { s.len() });
- | ^^^ ^ ^^^^^^^
+ | ~~~ ~ ~~~~~~~
error: using `Result.or_else(|x| Err(y))`, which is more succinctly expressed as `map_err(|x| y)`
--> $DIR/bind_instead_of_map_multipart.rs:11:13
help: try this
|
LL | let _ = Err::<(), _>("42").map_err(|s| if s.len() < 42 { s.len() + 20 } else { s.len() });
- | ^^^^^^^ ^^^^^^^^^^^^ ^^^^^^^
+ | ~~~~~~~ ~~~~~~~~~~~~ ~~~~~~~
error: using `Option.and_then(|x| Some(y))`, which is more succinctly expressed as `map(|x| y)`
--> $DIR/bind_instead_of_map_multipart.rs:19:5
|
help: try this
|
-LL | Some("42").map(|s| {
+LL ~ Some("42").map(|s| {
LL | if {
LL | if s == "43" {
-LL | return 43;
+LL ~ return 43;
LL | }
LL | s == "42"
...
help: try this
|
LL | let _ = Some("").map(|s| if s.len() == 20 { m!() } else { Some(20) });
- | ^^^ ^^^^ ^^^^^^^^
+ | ~~~ ~~~~ ~~~~~~~~
error: aborting due to 5 previous errors
= note: `-D clippy::blocks-in-if-conditions` implied by `-D warnings`
help: try
|
-LL | let res = {
-LL | let x = 3;
-LL | x == 3
-LL | }; if res {
+LL ~ let res = {
+LL + let x = 3;
+LL + x == 3
+LL ~ }; if res {
|
error: omit braces around single expression condition
= note: The end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving the end statements out like this
|
-LL | }
-LL | let result = false;
-LL | println!("Block end!");
-LL | result;
+LL ~ }
+LL + let result = false;
+LL + println!("Block end!");
+LL ~ result;
|
error: all if blocks contain the same code at the end
|
help: consider moving the end statements out like this
|
-LL | }
-LL | println!("Same end of block");
+LL ~ }
+LL + println!("Same end of block");
|
error: all if blocks contain the same code at the end
|
help: consider moving the end statements out like this
|
-LL | }
-LL | println!(
-LL | "I'm moveable because I know: `outer_scope_value`: '{}'",
-LL | outer_scope_value
-LL | );
+LL ~ }
+LL + println!(
+LL + "I'm moveable because I know: `outer_scope_value`: '{}'",
+LL + outer_scope_value
+LL + );
|
error: all if blocks contain the same code at the end
|
help: consider moving the end statements out like this
|
-LL | }
-LL | println!("Hello World");
+LL ~ }
+LL + println!("Hello World");
|
error: all if blocks contain the same code at the end
= warning: Some moved values might need to be renamed to avoid wrong references
help: consider moving the end statements out like this
|
-LL | }
-LL | let later_used_value = "A string value";
-LL | println!("{}", later_used_value);
+LL ~ }
+LL + let later_used_value = "A string value";
+LL + println!("{}", later_used_value);
|
error: all if blocks contain the same code at the end
= warning: Some moved values might need to be renamed to avoid wrong references
help: consider moving the end statements out like this
|
-LL | }
-LL | let simple_examples = "I now identify as a &str :)";
-LL | println!("This is the new simple_example: {}", simple_examples);
+LL ~ }
+LL + let simple_examples = "I now identify as a &str :)";
+LL + println!("This is the new simple_example: {}", simple_examples);
|
error: all if blocks contain the same code at the end
= note: The end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving the end statements out like this
|
-LL | }
-LL | x << 2;
+LL ~ }
+LL ~ x << 2;
|
error: all if blocks contain the same code at the end
= note: The end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving the end statements out like this
|
-LL | }
-LL | x * 4
+LL ~ }
+LL + x * 4
|
error: all if blocks contain the same code at the end
|
help: consider moving the end statements out like this
|
-LL | if x == 17 { b = 1; a = 0x99; } else { }
-LL | a = 0x99;
+LL ~ if x == 17 { b = 1; a = 0x99; } else { }
+LL + a = 0x99;
|
error: aborting due to 9 previous errors
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider moving the start statements out like this
|
-LL | println!("Hello World!");
-LL | if true {
+LL ~ println!("Hello World!");
+LL + if true {
|
error: all if blocks contain the same code at the start
= warning: Some moved values might need to be renamed to avoid wrong references
help: consider moving the start statements out like this
|
-LL | let y = 9;
-LL | println!("The value y was set to: `{}`", y);
-LL | let _z = y;
-LL | if x == 0 {
+LL ~ let y = 9;
+LL + println!("The value y was set to: `{}`", y);
+LL + let _z = y;
+LL + if x == 0 {
|
error: all if blocks contain the same code at the start
|
help: consider moving the start statements out like this
|
-LL | let y = 16;
-LL | let _ = if x == 7 {
+LL ~ let y = 16;
+LL + let _ = if x == 7 {
|
error: all if blocks contain the same code at the start
= warning: Some moved values might need to be renamed to avoid wrong references
help: consider moving the start statements out like this
|
-LL | let used_value_name = "Different type";
-LL | println!("Str: {}", used_value_name);
-LL | if x == 10 {
+LL ~ let used_value_name = "Different type";
+LL + println!("Str: {}", used_value_name);
+LL + if x == 10 {
|
error: all if blocks contain the same code at the start
= warning: Some moved values might need to be renamed to avoid wrong references
help: consider moving the start statements out like this
|
-LL | let can_be_overridden = "Move me";
-LL | println!("I'm also moveable");
-LL | if x == 11 {
+LL ~ let can_be_overridden = "Move me";
+LL + println!("I'm also moveable");
+LL + if x == 11 {
|
error: all if blocks contain the same code at the start
|
help: consider moving the start statements out like this
|
-LL | println!("This should trigger the `SHARED_CODE_IN_IF_BLOCKS` lint.");
-LL | println!("Because `IF_SAME_THEN_ELSE` is allowed here");
-LL | if x == 2020 {
+LL ~ println!("This should trigger the `SHARED_CODE_IN_IF_BLOCKS` lint.");
+LL + println!("Because `IF_SAME_THEN_ELSE` is allowed here");
+LL + if x == 2020 {
|
error: this `if` has identical blocks
| |_____^
help: consider moving the start statements out like this
|
-LL | let t = 7;
-LL | let _overlap_start = t * 2;
-LL | let _overlap_end = 2 * t;
-LL | if x == 7 {
+LL ~ let t = 7;
+LL + let _overlap_start = t * 2;
+LL + let _overlap_end = 2 * t;
+LL + if x == 7 {
|
help: and consider moving the end statements out like this
|
-LL | }
-LL | let _u = 9;
+LL ~ }
+LL + let _u = 9;
|
error: all if blocks contain the same code at the start and the end. Here at the start
= warning: Some moved values might need to be renamed to avoid wrong references
help: consider moving the start statements out like this
|
-LL | let r = 7;
-LL | let _overlap_start = r;
-LL | let _overlap_middle = r * r;
-LL | if x == 99 {
+LL ~ let r = 7;
+LL + let _overlap_start = r;
+LL + let _overlap_middle = r * r;
+LL + if x == 99 {
|
help: and consider moving the end statements out like this
|
-LL | }
-LL | let _overlap_end = r * r * r;
-LL | let z = "end";
+LL ~ }
+LL + let _overlap_end = r * r * r;
+LL + let z = "end";
|
error: all if blocks contain the same code at the start and the end. Here at the start
= warning: Some moved values might need to be renamed to avoid wrong references
help: consider moving the start statements out like this
|
-LL | let a = 0xcafe;
-LL | let b = 0xffff00ff;
-LL | let e_id = gen_id(a, b);
-LL | if (x > 7 && y < 13) || (x + y) % 2 == 1 {
+LL ~ let a = 0xcafe;
+LL + let b = 0xffff00ff;
+LL + let e_id = gen_id(a, b);
+LL + if (x > 7 && y < 13) || (x + y) % 2 == 1 {
|
help: and consider moving the end statements out like this
|
-LL | }
-LL | let pack = DataPack {
-LL | id: e_id,
-LL | name: "Player 1".to_string(),
-LL | some_data: vec![0x12, 0x34, 0x56, 0x78, 0x90],
-LL | };
+LL ~ }
+LL + let pack = DataPack {
+LL + id: e_id,
+LL + name: "Player 1".to_string(),
+LL + some_data: vec![0x12, 0x34, 0x56, 0x78, 0x90],
+LL + };
...
error: all if blocks contain the same code at the start and the end. Here at the start
= note: The end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving the start statements out like this
|
-LL | let _ = 19;
-LL | let _ = if x == 7 {
+LL ~ let _ = 19;
+LL + let _ = if x == 7 {
|
help: and consider moving the end statements out like this
|
-LL | }
-LL | x << 2;
+LL ~ }
+LL ~ x << 2;
|
error: all if blocks contain the same code at the start and the end. Here at the start
= note: The end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving the start statements out like this
|
-LL | let _ = 17;
-LL | if x == 9 {
+LL ~ let _ = 17;
+LL + if x == 9 {
|
help: and consider moving the end statements out like this
|
-LL | }
-LL | x * 4
+LL ~ }
+LL + x * 4
|
error: aborting due to 5 previous errors
= note: `-D clippy::collapsible-else-if` implied by `-D warnings`
help: collapse nested if block
|
-LL | } else if y == "world" {
-LL | println!("world!")
-LL | }
+LL ~ } else if y == "world" {
+LL + println!("world!")
+LL + }
|
error: this `else { if .. }` block can be collapsed
|
help: collapse nested if block
|
-LL | } else if let Some(42) = Some(42) {
-LL | println!("world!")
-LL | }
+LL ~ } else if let Some(42) = Some(42) {
+LL + println!("world!")
+LL + }
|
error: this `else { if .. }` block can be collapsed
|
help: collapse nested if block
|
-LL | } else if y == "world" {
-LL | println!("world")
-LL | }
-LL | else {
-LL | println!("!")
-LL | }
+LL ~ } else if y == "world" {
+LL + println!("world")
+LL + }
+LL + else {
+LL + println!("!")
+LL + }
|
error: this `else { if .. }` block can be collapsed
|
help: collapse nested if block
|
-LL | } else if let Some(42) = Some(42) {
-LL | println!("world")
-LL | }
-LL | else {
-LL | println!("!")
-LL | }
+LL ~ } else if let Some(42) = Some(42) {
+LL + println!("world")
+LL + }
+LL + else {
+LL + println!("!")
+LL + }
|
error: this `else { if .. }` block can be collapsed
|
help: collapse nested if block
|
-LL | } else if let Some(42) = Some(42) {
-LL | println!("world")
-LL | }
-LL | else {
-LL | println!("!")
-LL | }
+LL ~ } else if let Some(42) = Some(42) {
+LL + println!("world")
+LL + }
+LL + else {
+LL + println!("!")
+LL + }
|
error: this `else { if .. }` block can be collapsed
|
help: collapse nested if block
|
-LL | } else if x == "hello" {
-LL | println!("world")
-LL | }
-LL | else {
-LL | println!("!")
-LL | }
+LL ~ } else if x == "hello" {
+LL + println!("world")
+LL + }
+LL + else {
+LL + println!("!")
+LL + }
|
error: this `else { if .. }` block can be collapsed
|
help: collapse nested if block
|
-LL | } else if let Some(42) = Some(42) {
-LL | println!("world")
-LL | }
-LL | else {
-LL | println!("!")
-LL | }
+LL ~ } else if let Some(42) = Some(42) {
+LL + println!("world")
+LL + }
+LL + else {
+LL + println!("!")
+LL + }
|
error: aborting due to 7 previous errors
= note: `-D clippy::collapsible-if` implied by `-D warnings`
help: collapse nested if block
|
-LL | if x == "hello" && y == "world" {
-LL | println!("Hello world!");
-LL | }
+LL ~ if x == "hello" && y == "world" {
+LL + println!("Hello world!");
+LL + }
|
error: this `if` statement can be collapsed
|
help: collapse nested if block
|
-LL | if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
-LL | println!("Hello world!");
-LL | }
+LL ~ if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
+LL + println!("Hello world!");
+LL + }
|
error: this `if` statement can be collapsed
|
help: collapse nested if block
|
-LL | if x == "hello" && x == "world" && (y == "world" || y == "hello") {
-LL | println!("Hello world!");
-LL | }
+LL ~ if x == "hello" && x == "world" && (y == "world" || y == "hello") {
+LL + println!("Hello world!");
+LL + }
|
error: this `if` statement can be collapsed
|
help: collapse nested if block
|
-LL | if (x == "hello" || x == "world") && y == "world" && y == "hello" {
-LL | println!("Hello world!");
-LL | }
+LL ~ if (x == "hello" || x == "world") && y == "world" && y == "hello" {
+LL + println!("Hello world!");
+LL + }
|
error: this `if` statement can be collapsed
|
help: collapse nested if block
|
-LL | if x == "hello" && x == "world" && y == "world" && y == "hello" {
-LL | println!("Hello world!");
-LL | }
+LL ~ if x == "hello" && x == "world" && y == "world" && y == "hello" {
+LL + println!("Hello world!");
+LL + }
|
error: this `if` statement can be collapsed
|
help: collapse nested if block
|
-LL | if 42 == 1337 && 'a' != 'A' {
-LL | println!("world!")
-LL | }
+LL ~ if 42 == 1337 && 'a' != 'A' {
+LL + println!("world!")
+LL + }
|
error: this `if` statement can be collapsed
|
help: collapse nested if block
|
-LL | if x == "hello" && y == "world" { // Collapsible
-LL | println!("Hello world!");
-LL | }
+LL ~ if x == "hello" && y == "world" { // Collapsible
+LL + println!("Hello world!");
+LL + }
|
error: this `if` statement can be collapsed
help: consider adding a type parameter
|
LL | pub fn ice_3717<S: ::std::hash::BuildHasher + Default>(_: &HashSet<usize, S>) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~
help: ...and use generic constructor
|
LL | let _: HashSet<usize> = HashSet::default();
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
|
= note: `-D bare-trait-objects` implied by `-D warnings`
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/ice-3969.rs:27:16
| ^ help: use `dyn`: `dyn A`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: trait objects without an explicit `dyn` are deprecated
--> $DIR/ice-3969.rs:27:57
| ^ help: use `dyn`: `dyn A`
|
= warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021!
- = note: for more information, see issue #80165 <https://github.com/rust-lang/rust/issues/80165>
+ = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
error: aborting due to 3 previous errors
help: consider dereferencing the borrow
|
LL | Some(*reference) = cache.data.get(key) {
- | ^
+ | +
error[E0308]: mismatched types
--> $DIR/ice-6250.rs:12:9
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | fn bug<T>() -> impl Iterator<Item = [(); { |x: &[u8]| x }]> {
- | ^
+ | +
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
--> $DIR/ice-6251.rs:4:54
help: ensure to avoid having uses of it in version control
|
LL | if let Some(n) = n.checked_sub(4) { n } else { n }
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:8:8
help: ensure to avoid having uses of it in version control
|
LL | if n <= 1 {
- | ^^^^^^
+ | ~~~~~~
error: `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:9:9
help: ensure to avoid having uses of it in version control
|
LL | 42;
- | ^^
+ | ~~
error: `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:17:5
help: ensure to avoid having uses of it in version control
|
LL | dbg!(dbg!(42));
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:18:14
help: ensure to avoid having uses of it in version control
|
LL | foo(3) + factorial(4);
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: aborting due to 7 previous errors
|
help: try this
|
-LL | m.entry(k).or_insert_with(|| {
-LL | if true {
-LL | v
-LL | } else {
-LL | v2
-LL | }
+LL ~ m.entry(k).or_insert_with(|| {
+LL + if true {
+LL + v
+LL + } else {
+LL + v2
+LL + }
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | m.entry(k).or_insert_with(|| {
-LL | if true {
-LL | v
-LL | } else {
-LL | v2
-LL | }
+LL ~ m.entry(k).or_insert_with(|| {
+LL + if true {
+LL + v
+LL + } else {
+LL + v2
+LL + }
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
-LL | if true {
-LL | e.insert(v);
-LL | } else {
-LL | e.insert(v2);
-LL | return;
+LL ~ if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
+LL + if true {
+LL + e.insert(v);
+LL + } else {
+LL + e.insert(v2);
+LL + return;
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | m.entry(k).or_insert_with(|| {
-LL | foo();
-LL | v
-LL | });
+LL ~ m.entry(k).or_insert_with(|| {
+LL + foo();
+LL + v
+LL + });
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | m.entry(k).or_insert_with(|| {
-LL | match 0 {
-LL | 1 if true => {
-LL | v
-LL | },
-LL | _ => {
+LL ~ m.entry(k).or_insert_with(|| {
+LL + match 0 {
+LL + 1 if true => {
+LL + v
+LL + },
+LL + _ => {
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
-LL | match 0 {
-LL | 0 => foo(),
-LL | _ => {
-LL | e.insert(v2);
-LL | },
+LL ~ if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
+LL + match 0 {
+LL + 0 => foo(),
+LL + _ => {
+LL + e.insert(v2);
+LL + },
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | m.entry(k).or_insert_with(|| {
-LL | foo();
-LL | match 0 {
-LL | 0 if false => {
-LL | v
-LL | },
+LL ~ m.entry(k).or_insert_with(|| {
+LL + foo();
+LL + match 0 {
+LL + 0 if false => {
+LL + v
+LL + },
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | if let std::collections::btree_map::Entry::Vacant(e) = m.entry(k) {
-LL | e.insert(v);
-LL | foo();
-LL | }
+LL ~ if let std::collections::btree_map::Entry::Vacant(e) = m.entry(k) {
+LL + e.insert(v);
+LL + foo();
+LL + }
|
error: aborting due to 10 previous errors
= note: `-D clippy::map-entry` implied by `-D warnings`
help: try this
|
-LL | match m.entry(k) {
-LL | std::collections::hash_map::Entry::Vacant(e) => {
-LL | e.insert(v);
-LL | }
-LL | std::collections::hash_map::Entry::Occupied(mut e) => {
-LL | e.insert(v2);
+LL ~ match m.entry(k) {
+LL + std::collections::hash_map::Entry::Vacant(e) => {
+LL + e.insert(v);
+LL + }
+LL + std::collections::hash_map::Entry::Occupied(mut e) => {
+LL + e.insert(v2);
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | match m.entry(k) {
-LL | std::collections::hash_map::Entry::Occupied(mut e) => {
-LL | e.insert(v);
-LL | }
-LL | std::collections::hash_map::Entry::Vacant(e) => {
-LL | e.insert(v2);
+LL ~ match m.entry(k) {
+LL + std::collections::hash_map::Entry::Occupied(mut e) => {
+LL + e.insert(v);
+LL + }
+LL + std::collections::hash_map::Entry::Vacant(e) => {
+LL + e.insert(v2);
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
-LL | e.insert(v);
-LL | } else {
-LL | foo();
-LL | }
+LL ~ if let std::collections::hash_map::Entry::Vacant(e) = m.entry(k) {
+LL + e.insert(v);
+LL + } else {
+LL + foo();
+LL + }
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {
-LL | e.insert(v);
-LL | } else {
-LL | foo();
-LL | }
+LL ~ if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {
+LL + e.insert(v);
+LL + } else {
+LL + foo();
+LL + }
|
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | match m.entry(k) {
-LL | std::collections::hash_map::Entry::Vacant(e) => {
-LL | e.insert(v);
-LL | }
-LL | std::collections::hash_map::Entry::Occupied(mut e) => {
-LL | e.insert(v2);
+LL ~ match m.entry(k) {
+LL + std::collections::hash_map::Entry::Vacant(e) => {
+LL + e.insert(v);
+LL + }
+LL + std::collections::hash_map::Entry::Occupied(mut e) => {
+LL + e.insert(v2);
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | match m.entry(k) {
-LL | std::collections::hash_map::Entry::Occupied(mut e) => {
-LL | if true { Some(e.insert(v)) } else { Some(e.insert(v2)) }
-LL | }
-LL | std::collections::hash_map::Entry::Vacant(e) => {
-LL | e.insert(v);
+LL ~ match m.entry(k) {
+LL + std::collections::hash_map::Entry::Occupied(mut e) => {
+LL + if true { Some(e.insert(v)) } else { Some(e.insert(v2)) }
+LL + }
+LL + std::collections::hash_map::Entry::Vacant(e) => {
+LL + e.insert(v);
...
error: usage of `contains_key` followed by `insert` on a `HashMap`
|
help: try this
|
-LL | if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {
-LL | foo();
-LL | Some(e.insert(v))
-LL | } else {
-LL | None
-LL | };
+LL ~ if let std::collections::hash_map::Entry::Occupied(mut e) = m.entry(k) {
+LL + foo();
+LL + Some(e.insert(v))
+LL + } else {
+LL + None
+LL ~ };
|
error: aborting due to 7 previous errors
= note: `-D clippy::print-with-newline` implied by `-D warnings`
help: use `eprintln!` instead
|
-LL | eprintln!("Hello");
- | ^^^^^^^^ --
+LL - eprint!("Hello/n");
+LL + eprintln!("Hello");
+ |
error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:6:5
|
help: use `eprintln!` instead
|
-LL | eprintln!("Hello {}", "world");
- | ^^^^^^^^ --
+LL - eprint!("Hello {}/n", "world");
+LL + eprintln!("Hello {}", "world");
+ |
error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:7:5
|
help: use `eprintln!` instead
|
-LL | eprintln!("Hello {} {}", "world", "#2");
- | ^^^^^^^^ --
+LL - eprint!("Hello {} {}/n", "world", "#2");
+LL + eprintln!("Hello {} {}", "world", "#2");
+ |
error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:8:5
|
help: use `eprintln!` instead
|
-LL | eprintln!("{}", 1265);
- | ^^^^^^^^ --
+LL - eprint!("{}/n", 1265);
+LL + eprintln!("{}", 1265);
+ |
error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:9:5
|
help: use `eprintln!` instead
|
-LL | eprintln!();
- | ^^^^^^^^ --
+LL - eprint!("/n");
+LL + eprintln!();
+ |
error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:28:5
|
help: use `eprintln!` instead
|
-LL | eprintln!("/"); // should fail
- | ^^^^^^^^ --
+LL - eprint!("//n"); // should fail
+LL + eprintln!("/"); // should fail
+ |
error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:35:5
|
help: use `eprintln!` instead
|
-LL | eprintln!(
-LL | ""
+LL ~ eprintln!(
+LL ~ ""
|
error: using `eprint!()` with a format string that ends in a single newline
|
help: use `eprintln!` instead
|
-LL | eprintln!(
-LL | r""
+LL ~ eprintln!(
+LL ~ r""
|
error: using `eprint!()` with a format string that ends in a single newline
|
help: use `eprintln!` instead
|
-LL | eprintln!("/r"); //~ ERROR
- | ^^^^^^^^ --
+LL - eprint!("/r/n"); //~ ERROR
+LL + eprintln!("/r"); //~ ERROR
+ |
error: using `eprint!()` with a format string that ends in a single newline
--> $DIR/eprint_with_newline.rs:48:5
|
help: use `eprintln!` instead
|
-LL | eprintln!("foo/rbar") // ~ ERROR
- | ^^^^^^^^ --
+LL - eprint!("foo/rbar/n") // ~ ERROR
+LL + eprintln!("foo/rbar") // ~ ERROR
+ |
error: aborting due to 10 previous errors
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: try adding #[non_exhaustive]
|
-LL | #[non_exhaustive]
-LL | pub enum Exhaustive {
+LL ~ #[non_exhaustive]
+LL ~ pub enum Exhaustive {
|
error: exported enums should not be exhaustive
|
help: try adding #[non_exhaustive]
|
-LL | #[non_exhaustive]
-LL | pub enum ExhaustiveWithAttrs {
+LL ~ #[non_exhaustive]
+LL ~ pub enum ExhaustiveWithAttrs {
|
error: exported structs should not be exhaustive
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try adding #[non_exhaustive]
|
-LL | #[non_exhaustive]
-LL | pub struct Exhaustive {
+LL ~ #[non_exhaustive]
+LL ~ pub struct Exhaustive {
|
error: aborting due to 3 previous errors
help: use the corresponding method
|
LL | for v in m.values() {
- | ^ ^^^^^^^^^^
+ | ~ ~~~~~~~~~~
error: you seem to want to iterate on a map's values
--> $DIR/for_kv_map.rs:14:19
help: use the corresponding method
|
LL | for v in (*m).values() {
- | ^ ^^^^^^^^^^^^^
+ | ~ ~~~~~~~~~~~~~
error: you seem to want to iterate on a map's values
--> $DIR/for_kv_map.rs:22:19
help: use the corresponding method
|
LL | for v in m.values_mut() {
- | ^ ^^^^^^^^^^^^^^
+ | ~ ~~~~~~~~~~~~~~
error: you seem to want to iterate on a map's values
--> $DIR/for_kv_map.rs:27:19
help: use the corresponding method
|
LL | for v in (*m).values_mut() {
- | ^ ^^^^^^^^^^^^^^^^^
+ | ~ ~~~~~~~~~~~~~~~~~
error: you seem to want to iterate on a map's keys
--> $DIR/for_kv_map.rs:33:24
help: use the corresponding method
|
LL | for k in rm.keys() {
- | ^ ^^^^^^^^^
+ | ~ ~~~~~~~~~
error: aborting due to 5 previous errors
|
help: consider using `.to_string()`
|
-LL | r##"foo {}
-LL | " bar"##.to_string();
+LL ~ r##"foo {}
+LL + " bar"##.to_string();
|
error: useless use of `format!`
help: consider matching on `Ok(y)` and removing the call to `ok` instead
|
LL | if let Ok(y) = x.parse() { y } else { 0 }
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: matching on `Some` with `ok()` is redundant
--> $DIR/if_let_some_result.rs:16:9
help: consider matching on `Ok(y)` and removing the call to `ok` instead
|
LL | if let Ok(y) = x . parse() {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
help: consider adding a type parameter
|
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashMap<K, V, S> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
help: ...and use generic constructor
|
LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: impl for `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:25:36
help: consider adding a type parameter
|
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<i8> for (HashMap<K, V, S>,) {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
help: ...and use generic constructor
|
LL | ((HashMap::default(),), (HashMap::with_capacity_and_hasher(10, Default::default()),))
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: impl for `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:30:19
help: consider adding a type parameter
|
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashMap<String, String, S> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: ...and use generic constructor
|
LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: impl for `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:47:32
help: consider adding a type parameter
|
LL | impl<T: Hash + Eq, S: ::std::hash::BuildHasher + Default> Foo<i8> for HashSet<T, S> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~
help: ...and use generic constructor
|
LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: impl for `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:52:19
help: consider adding a type parameter
|
LL | impl<S: ::std::hash::BuildHasher + Default> Foo<i16> for HashSet<String, S> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~
help: ...and use generic constructor
|
LL | (HashSet::default(), HashSet::with_capacity_and_hasher(10, Default::default()))
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: parameter of type `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:69:23
help: consider adding a type parameter
|
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~
error: parameter of type `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:69:53
help: consider adding a type parameter
|
LL | pub fn foo<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~
error: impl for `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:73:43
help: consider adding a type parameter
|
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
help: ...and use generic constructor
|
LL | (HashMap::default(), HashMap::with_capacity_and_hasher(10, Default::default()))
- | ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: parameter of type `HashMap` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:81:33
help: consider adding a type parameter
|
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~~~~~~
error: parameter of type `HashSet` should be generalized over different hashers
--> $DIR/implicit_hasher.rs:81:63
help: consider adding a type parameter
|
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
+ | +++++++++++++++++++++++++++++ ~~~~~~~~~~~~~~~
error: aborting due to 10 previous errors
|
help: add `return` as shown
|
-LL | return loop {
-LL | m!(true);
-LL | }
+LL ~ return loop {
+LL + m!(true);
+LL + }
|
error: missing `return` statement
help: consider boxing the large fields to reduce the total size of the enum
|
LL | B(Box<[i32; 8000]>),
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: large size difference between variants
--> $DIR/large_enum_variant.rs:36:5
help: consider boxing the large fields to reduce the total size of the enum
|
LL | ContainingLargeEnum(Box<LargeEnum>),
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: large size difference between variants
--> $DIR/large_enum_variant.rs:46:5
help: consider boxing the large fields to reduce the total size of the enum
|
LL | StructLikeLarge2 { x: Box<[i32; 8000]> },
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
= note: `-D clippy::let-and-return` implied by `-D warnings`
help: return the expression directly
|
-LL |
-LL | 5
+LL ~
+LL ~ 5
|
error: returning the result of a `let` binding from a block
|
help: return the expression directly
|
-LL |
-LL | 5
+LL ~
+LL ~ 5
|
error: returning the result of a `let` binding from a block
|
help: return the expression directly
|
-LL |
-LL | Arc::clone(&self.foo) as _
+LL ~
+LL ~ Arc::clone(&self.foo) as _
|
error: aborting due to 3 previous errors
|
help: omit the `let` binding
|
-LL | v
-LL | .into_iter()
-LL | .map(|i| i * 2)
-LL | .filter(|i| i % 2 == 0)
-LL | .map(|_| ())
-LL | .next()
+LL ~ v
+LL + .into_iter()
+LL + .map(|i| i * 2)
+LL + .filter(|i| i % 2 == 0)
+LL + .map(|_| ())
+LL + .next()
...
error: aborting due to 3 previous errors
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
|
LL | let fail_multi_zero = 123usize;
- | ^^^^^^^^
+ | ~~~~~~~~
help: if you mean to use an octal constant, use `0o`
|
LL | let fail_multi_zero = 0o123usize;
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: this is a decimal constant
--> $DIR/literals.rs:21:17
help: if you mean to use a decimal constant, remove the `0` to avoid confusion
|
LL | let fail8 = 123;
- | ^^^
+ | ~~~
help: if you mean to use an octal constant, use `0o`
|
LL | let fail8 = 0o123;
- | ^^^^^
+ | ~~~~~
error: digits grouped inconsistently by underscores
--> $DIR/literals.rs:33:18
help: make the function `async` and return the output of the future directly
|
LL | async fn fut() -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn fut() -> impl Future<Output = i32> { 42 }
- | ^^^^^^
+ | ~~~~~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:13:1
help: make the function `async` and return the output of the future directly
|
LL | async fn fut2() -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn fut2() ->impl Future<Output = i32> { 42 }
- | ^^^^^^
+ | ~~~~~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:18:1
help: make the function `async` and return the output of the future directly
|
LL | async fn fut3() -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn fut3()-> impl Future<Output = i32> { 42 }
- | ^^^^^^
+ | ~~~~~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:22:1
help: make the function `async` and remove the return type
|
LL | async fn empty_fut() {
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn empty_fut() -> impl Future<Output = ()> {}
- | ^^
+ | ~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:27:1
help: make the function `async` and remove the return type
|
LL | async fn empty_fut2() {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn empty_fut2() ->impl Future<Output = ()> {}
- | ^^
+ | ~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:32:1
help: make the function `async` and remove the return type
|
LL | async fn empty_fut3() {
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn empty_fut3()-> impl Future<Output = ()> {}
- | ^^
+ | ~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:36:1
help: make the function `async` and return the output of the future directly
|
LL | async fn core_fut() -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn core_fut() -> impl core::future::Future<Output = i32> { 42 }
- | ^^^^^^
+ | ~~~~~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:58:5
help: make the function `async` and return the output of the future directly
|
LL | async fn inh_fut() -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
-LL | fn inh_fut() -> impl Future<Output = i32> {
-LL | // NOTE: this code is here just to check that the indentation is correct in the suggested fix
-LL | let a = 42;
-LL | let b = 21;
-LL | if a < b {
-LL | let c = 21;
+LL ~ fn inh_fut() -> impl Future<Output = i32> {
+LL + // NOTE: this code is here just to check that the indentation is correct in the suggested fix
+LL + let a = 42;
+LL + let b = 21;
+LL + if a < b {
+LL + let c = 21;
...
error: this function can be simplified using the `async fn` syntax
help: make the function `async` and return the output of the future directly
|
LL | async fn elided(_: &i32) -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn elided(_: &i32) -> impl Future<Output = i32> + '_ { 42 }
- | ^^^^^^
+ | ~~~~~~
error: this function can be simplified using the `async fn` syntax
--> $DIR/manual_async_fn.rs:102:1
help: make the function `async` and return the output of the future directly
|
LL | async fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> i32 {
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: move the body of the async block to the enclosing function
|
LL | fn explicit<'a, 'b>(_: &'a i32, _: &'b i32) -> impl Future<Output = i32> + 'a + 'b { 42 }
- | ^^^^^^
+ | ~~~~~~
error: aborting due to 10 previous errors
|
help: try replacing the loop by
|
-LL | dst[3..(src.len() + 3)].clone_from_slice(&src[..]);
-LL | dst2[30..(src.len() + 30)].clone_from_slice(&src[..]);
+LL ~ dst[3..(src.len() + 3)].clone_from_slice(&src[..]);
+LL + dst2[30..(src.len() + 30)].clone_from_slice(&src[..]);
|
error: it looks like you're manually copying between slices
|
help: try replacing the loop by
|
-LL | dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)]);
-LL | dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]);
+LL ~ dst[10..256].clone_from_slice(&src[(10 - 5)..(256 - 5)]);
+LL + dst2[(10 + 500)..(256 + 500)].clone_from_slice(&src[10..256]);
|
error: it looks like you're manually copying between slices
|
help: replace with
|
-LL | foo.ok_or(&format!(
-LL | "{}{}{}{}{}{}{}",
-LL | "Alice", "Bob", "Sarah", "Marc", "Sandra", "Eric", "Jenifer"));
+LL ~ foo.ok_or(&format!(
+LL + "{}{}{}{}{}{}{}",
+LL ~ "Alice", "Bob", "Sarah", "Marc", "Sandra", "Eric", "Jenifer"));
|
error: aborting due to 4 previous errors
| ^^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = s.strip_prefix("ab") {
-LL | str::to_string(<stripped>);
-LL | <stripped>.to_string();
+LL ~ if let Some(<stripped>) = s.strip_prefix("ab") {
+LL ~ str::to_string(<stripped>);
+LL ~ <stripped>.to_string();
LL |
-LL | str::to_string(<stripped>);
-LL | <stripped>.to_string();
+LL ~ str::to_string(<stripped>);
+LL ~ <stripped>.to_string();
|
error: stripping a suffix manually
| ^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_suffix` method
|
-LL | if let Some(<stripped>) = s.strip_suffix("bc") {
-LL | str::to_string(<stripped>);
-LL | <stripped>.to_string();
+LL ~ if let Some(<stripped>) = s.strip_suffix("bc") {
+LL ~ str::to_string(<stripped>);
+LL ~ <stripped>.to_string();
LL |
-LL | str::to_string(<stripped>);
-LL | <stripped>.to_string();
+LL ~ str::to_string(<stripped>);
+LL ~ <stripped>.to_string();
|
error: stripping a prefix manually
| ^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = s.strip_prefix('a') {
-LL | str::to_string(<stripped>);
-LL | <stripped>.to_string();
+LL ~ if let Some(<stripped>) = s.strip_prefix('a') {
+LL ~ str::to_string(<stripped>);
+LL ~ <stripped>.to_string();
|
error: stripping a prefix manually
| ^^^^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = s.strip_prefix(prefix) {
-LL | str::to_string(<stripped>);
+LL ~ if let Some(<stripped>) = s.strip_prefix(prefix) {
+LL ~ str::to_string(<stripped>);
|
error: stripping a prefix manually
| ^^^^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = s.strip_prefix(PREFIX) {
-LL | str::to_string(<stripped>);
-LL | str::to_string(<stripped>);
+LL ~ if let Some(<stripped>) = s.strip_prefix(PREFIX) {
+LL ~ str::to_string(<stripped>);
+LL ~ str::to_string(<stripped>);
|
error: stripping a prefix manually
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = TARGET.strip_prefix(prefix) {
-LL | str::to_string(<stripped>);
+LL ~ if let Some(<stripped>) = TARGET.strip_prefix(prefix) {
+LL ~ str::to_string(<stripped>);
|
error: stripping a prefix manually
| ^^^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = s1.strip_prefix("ab") {
-LL | <stripped>.to_uppercase();
+LL ~ if let Some(<stripped>) = s1.strip_prefix("ab") {
+LL ~ <stripped>.to_uppercase();
|
error: aborting due to 7 previous errors
|
help: replace with
|
-LL | Some(1).unwrap_or({
-LL | 42 + 42
-LL | + 42 + 42 + 42
-LL | + 42 + 42 + 42
-LL | });
+LL ~ Some(1).unwrap_or({
+LL + 42 + 42
+LL + + 42 + 42 + 42
+LL + + 42 + 42 + 42
+LL ~ });
|
error: this pattern reimplements `Option::unwrap_or`
|
help: replace with
|
-LL | Ok::<i32, &str>(1).unwrap_or({
-LL | 42 + 42
-LL | + 42 + 42 + 42
-LL | + 42 + 42 + 42
-LL | });
+LL ~ Ok::<i32, &str>(1).unwrap_or({
+LL + 42 + 42
+LL + + 42 + 42 + 42
+LL + + 42 + 42 + 42
+LL ~ });
|
error: this pattern reimplements `Result::unwrap_or`
= note: `-D clippy::map-unwrap-or` implied by `-D warnings`
help: use `map_or(<a>, <f>)` instead
|
-LL | let _ = opt.map_or(0, |x| x + 1);
- | ^^^^^^ ^^ --
+LL - let _ = opt.map(|x| x + 1)
+LL + let _ = opt.map_or(0, |x| x + 1);
+ |
error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
--> $DIR/map_unwrap_or.rs:20:13
|
help: use `map_or(<a>, <f>)` instead
|
-LL | let _ = opt.map_or(0, |x| {
+LL ~ let _ = opt.map_or(0, |x| {
LL | x + 1
LL | }
-LL | );
+LL ~ );
|
error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
|
help: use `map_or(<a>, <f>)` instead
|
-LL | let _ = opt.map_or({
-LL | 0
-LL | }, |x| x + 1);
+LL ~ let _ = opt.map_or({
+LL + 0
+LL ~ }, |x| x + 1);
|
error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
|
help: use `and_then(<f>)` instead
|
-LL | let _ = opt.and_then(|x| Some(x + 1));
- | ^^^^^^^^ --
+LL - let _ = opt.map(|x| Some(x + 1)).unwrap_or(None);
+LL + let _ = opt.and_then(|x| Some(x + 1));
+ |
error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
--> $DIR/map_unwrap_or.rs:31:13
|
help: use `and_then(<f>)` instead
|
-LL | let _ = opt.and_then(|x| {
+LL ~ let _ = opt.and_then(|x| {
LL | Some(x + 1)
LL | }
-LL | );
+LL ~ );
|
error: called `map(<f>).unwrap_or(None)` on an `Option` value. This can be done more directly by calling `and_then(<f>)` instead
|
help: use `and_then(<f>)` instead
|
-LL | .and_then(|x| Some(x + 1));
- | ^^^^^^^^ --
+LL - .map(|x| Some(x + 1))
+LL + .and_then(|x| Some(x + 1));
+ |
error: called `map(<f>).unwrap_or(<a>)` on an `Option` value. This can be done more directly by calling `map_or(<a>, <f>)` instead
--> $DIR/map_unwrap_or.rs:46:13
|
help: use `map_or(<a>, <f>)` instead
|
-LL | let _ = Some("prefix").map_or(id, |p| format!("{}.", p));
- | ^^^^^^ ^^^ --
+LL - let _ = Some("prefix").map(|p| format!("{}.", p)).unwrap_or(id);
+LL + let _ = Some("prefix").map_or(id, |p| format!("{}.", p));
+ |
error: called `map(<f>).unwrap_or_else(<g>)` on an `Option` value. This can be done more directly by calling `map_or_else(<g>, <f>)` instead
--> $DIR/map_unwrap_or.rs:50:13
|
help: consider using an `if`/`else` expression
|
-LL | if !test {
-LL | println!("Noooo!");
-LL | };
+LL ~ if !test {
+LL + println!("Noooo!");
+LL ~ };
|
error: you seem to be trying to match on a boolean expression
|
help: consider using an `if`/`else` expression
|
-LL | if !test {
-LL | println!("Noooo!");
-LL | };
+LL ~ if !test {
+LL + println!("Noooo!");
+LL ~ };
|
error: you seem to be trying to match on a boolean expression
|
help: consider using an `if`/`else` expression
|
-LL | if !(test && test) {
-LL | println!("Noooo!");
-LL | };
+LL ~ if !(test && test) {
+LL + println!("Noooo!");
+LL ~ };
|
error: equal expressions as operands to `&&`
|
help: consider using an `if`/`else` expression
|
-LL | if test {
-LL | println!("Yes!");
-LL | } else {
-LL | println!("Noooo!");
-LL | };
+LL ~ if test {
+LL + println!("Yes!");
+LL + } else {
+LL + println!("Noooo!");
+LL ~ };
|
error: aborting due to 8 previous errors
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
help: try
|
-LL | let _res = match val {
-LL | Some(ref _a) => true,
+LL ~ let _res = match val {
+LL ~ Some(ref _a) => true,
|
error: match expression looks like `matches!` macro
|
help: try
|
-LL | let _res = match val {
-LL | Some(ref _a) => true,
+LL ~ let _res = match val {
+LL ~ Some(ref _a) => true,
|
error: aborting due to 14 previous errors
= note: `-D clippy::match-ref-pats` implied by `-D warnings`
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
-LL | match *v {
-LL | Some(v) => println!("{:?}", v),
-LL | None => println!("none"),
+LL ~ match *v {
+LL ~ Some(v) => println!("{:?}", v),
+LL ~ None => println!("none"),
|
error: you don't need to add `&` to all patterns
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
-LL | match *tup {
-LL | (v, 1) => println!("{}", v),
+LL ~ match *tup {
+LL ~ (v, 1) => println!("{}", v),
|
error: you don't need to add `&` to both the expression and the patterns
|
help: try
|
-LL | match w {
-LL | Some(v) => println!("{:?}", v),
-LL | None => println!("none"),
+LL ~ match w {
+LL ~ Some(v) => println!("{:?}", v),
+LL ~ None => println!("none"),
|
error: redundant pattern matching, consider using `is_none()`
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
LL | if let None = *a {
- | ^^^^ ^^
+ | ~~~~ ~~
error: redundant pattern matching, consider using `is_none()`
--> $DIR/match_ref_pats.rs:40:12
help: try
|
LL | if let None = b {
- | ^^^^ ^
+ | ~~~~ ~
error: you don't need to add `&` to all patterns
--> $DIR/match_ref_pats.rs:67:9
|
help: instead of prefixing all patterns with `&`, you can dereference the expression
|
-LL | match *foo_variant!(0) {
-LL | Foo::A => println!("A"),
+LL ~ match *foo_variant!(0) {
+LL ~ Foo::A => println!("A"),
|
error: aborting due to 8 previous errors
= note: `-D clippy::match-single-binding` implied by `-D warnings`
help: consider using `let` statement
|
-LL | let (x, y, z) = (a, b, c);
-LL | {
-LL | println!("{} {} {}", x, y, z);
-LL | }
+LL ~ let (x, y, z) = (a, b, c);
+LL + {
+LL + println!("{} {} {}", x, y, z);
+LL + }
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | let (x, y, z) = (a, b, c);
-LL | println!("{} {} {}", x, y, z);
+LL ~ let (x, y, z) = (a, b, c);
+LL + println!("{} {} {}", x, y, z);
|
error: this match could be replaced by its body itself
|
help: consider using the match body instead
|
-LL | {
-LL | let x = 29;
-LL | println!("x has a value of {}", x);
-LL | }
+LL ~ {
+LL + let x = 29;
+LL + println!("x has a value of {}", x);
+LL + }
|
error: this match could be replaced by its body itself
|
help: consider using the match body instead
|
-LL | {
-LL | let e = 5 * a;
-LL | if e >= 5 {
-LL | println!("e is superior to 5");
-LL | }
-LL | }
+LL ~ {
+LL + let e = 5 * a;
+LL + if e >= 5 {
+LL + println!("e is superior to 5");
+LL + }
+LL + }
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | let Point { x, y } = p;
-LL | println!("Coords: ({}, {})", x, y);
+LL ~ let Point { x, y } = p;
+LL + println!("Coords: ({}, {})", x, y);
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | let Point { x: x1, y: y1 } = p;
-LL | println!("Coords: ({}, {})", x1, y1);
+LL ~ let Point { x: x1, y: y1 } = p;
+LL + println!("Coords: ({}, {})", x1, y1);
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | let ref r = x;
-LL | println!("Got a reference to {}", r);
+LL ~ let ref r = x;
+LL + println!("Got a reference to {}", r);
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | let ref mut mr = x;
-LL | println!("Got a mutable reference to {}", mr);
+LL ~ let ref mut mr = x;
+LL + println!("Got a mutable reference to {}", mr);
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | let Point { x, y } = coords();
-LL | let product = x * y;
+LL ~ let Point { x, y } = coords();
+LL + let product = x * y;
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | .map(|i| {
-LL | let unwrapped = i.unwrap();
-LL | unwrapped
-LL | })
+LL ~ .map(|i| {
+LL + let unwrapped = i.unwrap();
+LL + unwrapped
+LL ~ })
|
error: aborting due to 11 previous errors
= note: `-D clippy::match-single-binding` implied by `-D warnings`
help: consider using `let` statement
|
-LL | Some((iter, _item)) => {
-LL | let (min, max) = iter.size_hint();
-LL | (min.saturating_add(1), max.and_then(|max| max.checked_add(1)))
-LL | },
+LL ~ Some((iter, _item)) => {
+LL + let (min, max) = iter.size_hint();
+LL + (min.saturating_add(1), max.and_then(|max| max.checked_add(1)))
+LL ~ },
|
error: this match could be written as a `let` statement
|
help: consider using `let` statement
|
-LL | let (a, b) = get_tup();
-LL | println!("a {:?} and b {:?}", a, b);
+LL ~ let (a, b) = get_tup();
+LL + println!("a {:?} and b {:?}", a, b);
|
error: this match could be replaced by its scrutinee and body
|
help: consider using the scrutinee and body instead
|
-LL | side_effects();
-LL | println!("Side effects");
+LL ~ side_effects();
+LL + println!("Side effects");
|
error: this match could be replaced by its scrutinee and body
|
help: consider using the scrutinee and body instead
|
-LL | match x {
-LL | 0 => 1,
-LL | _ => 2,
-LL | };
-LL | println!("Single branch");
+LL ~ match x {
+LL + 0 => 1,
+LL + _ => 2,
+LL + };
+LL + println!("Single branch");
|
error: aborting due to 4 previous errors
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = s.strip_prefix("hello, ") {
-LL | assert_eq!(<stripped>.to_uppercase(), "WORLD!");
+LL ~ if let Some(<stripped>) = s.strip_prefix("hello, ") {
+LL ~ assert_eq!(<stripped>.to_uppercase(), "WORLD!");
|
error: stripping a prefix manually
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: try using the `strip_prefix` method
|
-LL | if let Some(<stripped>) = s.strip_prefix("hello, ") {
-LL | assert_eq!(<stripped>.to_uppercase(), "WORLD!");
+LL ~ if let Some(<stripped>) = s.strip_prefix("hello, ") {
+LL ~ assert_eq!(<stripped>.to_uppercase(), "WORLD!");
|
error: aborting due to 2 previous errors
help: try
|
LL | #[cfg(all(not(any(target_os = "solaris", linux)), freebsd))]
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
help: try
|
LL | #[cfg(all(not(any(solaris, target_os = "linux")), freebsd))]
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
help: try
|
LL | #[cfg(all(not(any(solaris, linux)), target_os = "freebsd"))]
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 17 previous errors
help: try this
|
LL | Some(x) => x,
- | ^ ^
+ | ~ ~
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:72:14
|
help: try this
|
-LL | Some(x) => {
-LL | f1(x);
+LL ~ Some(x) => {
LL | f1(x);
+LL ~ f1(x);
|
error: this pattern creates a reference to a reference
|
help: try this
|
-LL | let (y,) = (&x,);
-LL | let _: &String = y;
+LL ~ let (y,) = (&x,);
+LL ~ let _: &String = y;
|
error: this pattern creates a reference to a reference
help: try this
|
LL | E::A(x) | E::B(x) => x,
- | ^ ^ ^
+ | ~ ~ ~
error: this pattern creates a reference to a reference
--> $DIR/needless_borrow_pat.rs:118:21
|
help: try this
|
-LL | fn f2<'a>(&x: &&'a String) -> &'a String {
+LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
LL | let _: &String = x;
-LL | x
+LL ~ x
|
error: this pattern creates a reference to a reference
|
help: try this
|
-LL | fn f(&x: &&String) {
-LL | let _: &String = x;
+LL ~ fn f(&x: &&String) {
+LL ~ let _: &String = x;
|
error: aborting due to 12 previous errors
= note: `-D clippy::needless-collect` implied by `-D warnings`
help: use the original Iterator instead of collecting it and then producing a new one
|
-LL |
-LL | sample.iter().map(|x| (x, x + 1)).collect::<HashMap<_, _>>();
+LL ~
+LL ~ sample.iter().map(|x| (x, x + 1)).collect::<HashMap<_, _>>();
|
error: avoid using `collect()` when not needed
|
help: take the original Iterator's count instead of collecting it and finding the length
|
-LL |
-LL | sample.iter().count();
+LL ~
+LL ~ sample.iter().count();
|
error: avoid using `collect()` when not needed
|
help: check if the original Iterator has anything instead of collecting it and seeing if it's empty
|
-LL |
-LL | sample.iter().next().is_none();
+LL ~
+LL ~ sample.iter().next().is_none();
|
error: avoid using `collect()` when not needed
|
help: check if the original Iterator contains an element instead of collecting then checking
|
-LL |
-LL | sample.iter().any(|x| x == &5);
+LL ~
+LL ~ sample.iter().any(|x| x == &5);
|
error: avoid using `collect()` when not needed
|
help: check if the original Iterator contains an element instead of collecting then checking
|
-LL |
-LL | sample.into_iter().any(|x| x == a);
+LL ~
+LL ~ sample.into_iter().any(|x| x == a);
|
error: avoid using `collect()` when not needed
|
help: take the original Iterator's count instead of collecting it and finding the length
|
-LL |
-LL | string.split('/').count()
+LL ~
+LL ~ string.split('/').count()
|
error: avoid using `collect()` when not needed
|
help: take the original Iterator's count instead of collecting it and finding the length
|
-LL |
-LL | sample.iter().count()
+LL ~
+LL ~ sample.iter().count()
|
error: avoid using `collect()` when not needed
|
help: take the original Iterator's count instead of collecting it and finding the length
|
-LL |
-LL | sample.iter().count()
+LL ~
+LL ~ sample.iter().count()
|
error: avoid using `collect()` when not needed
|
help: take the original Iterator's count instead of collecting it and finding the length
|
-LL |
-LL | sample.iter().count()
+LL ~
+LL ~ sample.iter().count()
|
error: aborting due to 9 previous errors
= note: `-D clippy::needless-for-each` implied by `-D warnings`
help: try
|
-LL | for elem in v.iter() {
-LL | acc += elem;
-LL | }
+LL ~ for elem in v.iter() {
+LL + acc += elem;
+LL + }
|
error: needless use of `for_each`
|
help: try
|
-LL | for elem in v.into_iter() {
-LL | acc += elem;
-LL | }
+LL ~ for elem in v.into_iter() {
+LL + acc += elem;
+LL + }
|
error: needless use of `for_each`
|
help: try
|
-LL | for elem in [1, 2, 3].iter() {
-LL | acc += elem;
-LL | }
+LL ~ for elem in [1, 2, 3].iter() {
+LL + acc += elem;
+LL + }
|
error: needless use of `for_each`
|
help: try
|
-LL | for (k, v) in hash_map.iter() {
-LL | acc += k + v;
-LL | }
+LL ~ for (k, v) in hash_map.iter() {
+LL + acc += k + v;
+LL + }
|
error: needless use of `for_each`
|
help: try
|
-LL | for (k, v) in hash_map.iter_mut() {
-LL | acc += *k + *v;
-LL | }
+LL ~ for (k, v) in hash_map.iter_mut() {
+LL + acc += *k + *v;
+LL + }
|
error: needless use of `for_each`
|
help: try
|
-LL | for k in hash_map.keys() {
-LL | acc += k;
-LL | }
+LL ~ for k in hash_map.keys() {
+LL + acc += k;
+LL + }
|
error: needless use of `for_each`
|
help: try
|
-LL | for v in hash_map.values() {
-LL | acc += v;
-LL | }
+LL ~ for v in hash_map.values() {
+LL + acc += v;
+LL + }
|
error: needless use of `for_each`
|
help: try
|
-LL | for elem in my_vec().iter() {
-LL | acc += elem;
-LL | }
+LL ~ for elem in my_vec().iter() {
+LL + acc += elem;
+LL + }
|
error: aborting due to 8 previous errors
= note: `-D clippy::needless-for-each` implied by `-D warnings`
help: try
|
-LL | for v in v.iter() {
-LL | if *v == 10 {
-LL | return;
-LL | } else {
-LL | println!("{}", v);
-LL | }
+LL ~ for v in v.iter() {
+LL + if *v == 10 {
+LL + return;
+LL + } else {
+LL + println!("{}", v);
+LL + }
...
help: ...and replace `return` with `continue`
|
LL | continue;
- | ^^^^^^^^
+ | ~~~~~~~~
error: aborting due to previous error
help: consider changing the type to
|
LL | fn issue_2114(s: String, t: &str, u: Vec<i32>, v: Vec<i32>) {
- | ^^^^
+ | ~~~~
help: change `t.clone()` to
|
LL | let _ = t.to_string();
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:81:40
help: consider changing the type to
|
LL | fn issue_2114(s: String, t: String, u: Vec<i32>, v: &[i32]) {
- | ^^^^^^
+ | ~~~~~~
help: change `v.clone()` to
|
LL | let _ = v.to_owned();
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: this argument is passed by value, but not consumed in the function body
--> $DIR/needless_pass_by_value.rs:94:12
help: consider using an iterator
|
LL | for <item> in &vec {
- | ^^^^^^ ^^^^
+ | ~~~~~~ ~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop.rs:19:14
help: consider using an iterator
|
LL | for <item> in &vec {
- | ^^^^^^ ^^^^
+ | ~~~~~~ ~~~~
error: the loop variable `j` is only used to index `STATIC`
--> $DIR/needless_range_loop.rs:24:14
help: consider using an iterator
|
LL | for <item> in &STATIC {
- | ^^^^^^ ^^^^^^^
+ | ~~~~~~ ~~~~~~~
error: the loop variable `j` is only used to index `CONST`
--> $DIR/needless_range_loop.rs:28:14
help: consider using an iterator
|
LL | for <item> in &CONST {
- | ^^^^^^ ^^^^^^
+ | ~~~~~~ ~~~~~~
error: the loop variable `i` is used to index `vec`
--> $DIR/needless_range_loop.rs:32:14
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter().enumerate() {
- | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `vec2`
--> $DIR/needless_range_loop.rs:40:14
help: consider using an iterator
|
LL | for <item> in vec2.iter().take(vec.len()) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop.rs:44:14
help: consider using an iterator
|
LL | for <item> in vec.iter().skip(5) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop.rs:48:14
help: consider using an iterator
|
LL | for <item> in vec.iter().take(MAX_LEN) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop.rs:52:14
help: consider using an iterator
|
LL | for <item> in vec.iter().take(MAX_LEN + 1) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop.rs:56:14
help: consider using an iterator
|
LL | for <item> in vec.iter().take(10).skip(5) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop.rs:60:14
help: consider using an iterator
|
LL | for <item> in vec.iter().take(10 + 1).skip(5) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is used to index `vec`
--> $DIR/needless_range_loop.rs:64:14
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter().enumerate().skip(5) {
- | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is used to index `vec`
--> $DIR/needless_range_loop.rs:68:14
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter().enumerate().take(10).skip(5) {
- | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is used to index `vec`
--> $DIR/needless_range_loop.rs:73:14
help: consider using an iterator
|
LL | for (i, <item>) in vec.iter_mut().enumerate() {
- | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 14 previous errors
help: consider using an iterator
|
LL | for <item> in ns.iter().take(10).skip(3) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `ms`
--> $DIR/needless_range_loop2.rs:31:14
help: consider using an iterator
|
LL | for <item> in &mut ms {
- | ^^^^^^ ^^^^^^^
+ | ~~~~~~ ~~~~~~~
error: the loop variable `i` is only used to index `ms`
--> $DIR/needless_range_loop2.rs:37:14
help: consider using an iterator
|
LL | for <item> in &mut ms {
- | ^^^^^^ ^^^^^^^
+ | ~~~~~~ ~~~~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop2.rs:61:14
help: consider using an iterator
|
LL | for <item> in vec.iter_mut().skip(x).take(4) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `vec`
--> $DIR/needless_range_loop2.rs:68:14
help: consider using an iterator
|
LL | for <item> in vec.iter_mut().skip(x).take(4 + 1) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `arr`
--> $DIR/needless_range_loop2.rs:74:14
help: consider using an iterator
|
LL | for <item> in &arr {
- | ^^^^^^ ^^^^
+ | ~~~~~~ ~~~~
error: the loop variable `i` is only used to index `arr`
--> $DIR/needless_range_loop2.rs:78:14
help: consider using an iterator
|
LL | for <item> in arr.iter().take(2) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~
error: the loop variable `i` is only used to index `arr`
--> $DIR/needless_range_loop2.rs:82:14
help: consider using an iterator
|
LL | for <item> in arr.iter().skip(1) {
- | ^^^^^^ ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~ ~~~~~~~~~~~~~~~~~~
error: aborting due to 8 previous errors
= note: `-D clippy::new-without-default` implied by `-D warnings`
help: try adding this
|
-LL | impl Default for Foo {
-LL | fn default() -> Self {
-LL | Self::new()
-LL | }
-LL | }
+LL + impl Default for Foo {
+LL + fn default() -> Self {
+LL + Self::new()
+LL + }
+LL + }
|
error: you should consider adding a `Default` implementation for `Bar`
|
help: try adding this
|
-LL | impl Default for Bar {
-LL | fn default() -> Self {
-LL | Self::new()
-LL | }
-LL | }
+LL + impl Default for Bar {
+LL + fn default() -> Self {
+LL + Self::new()
+LL + }
+LL + }
|
error: you should consider adding a `Default` implementation for `LtKo<'c>`
|
help: try adding this
|
-LL | impl<'c> Default for LtKo<'c> {
-LL | fn default() -> Self {
-LL | Self::new()
-LL | }
-LL | }
+LL + impl<'c> Default for LtKo<'c> {
+LL + fn default() -> Self {
+LL + Self::new()
+LL + }
+LL + }
|
error: you should consider adding a `Default` implementation for `NewNotEqualToDerive`
|
help: try adding this
|
-LL | impl Default for NewNotEqualToDerive {
-LL | fn default() -> Self {
-LL | Self::new()
-LL | }
-LL | }
+LL + impl Default for NewNotEqualToDerive {
+LL + fn default() -> Self {
+LL + Self::new()
+LL + }
+LL + }
|
error: you should consider adding a `Default` implementation for `FooGenerics<T>`
|
help: try adding this
|
-LL | impl<T> Default for FooGenerics<T> {
-LL | fn default() -> Self {
-LL | Self::new()
-LL | }
-LL | }
+LL + impl<T> Default for FooGenerics<T> {
+LL + fn default() -> Self {
+LL + Self::new()
+LL + }
+LL + }
|
error: you should consider adding a `Default` implementation for `BarGenerics<T>`
|
help: try adding this
|
-LL | impl<T: Copy> Default for BarGenerics<T> {
-LL | fn default() -> Self {
-LL | Self::new()
-LL | }
-LL | }
+LL + impl<T: Copy> Default for BarGenerics<T> {
+LL + fn default() -> Self {
+LL + Self::new()
+LL + }
+LL + }
|
error: you should consider adding a `Default` implementation for `Foo<T>`
|
help: try adding this
|
-LL | impl<T> Default for Foo<T> {
-LL | fn default() -> Self {
-LL | Self::new()
-LL | }
-LL | }
-LL |
+LL ~ impl<T> Default for Foo<T> {
+LL + fn default() -> Self {
+LL + Self::new()
+LL + }
+LL + }
+LL +
...
error: aborting due to 7 previous errors
help: try
|
LL | let _ = a == b && c == 5;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
LL | let _ = !(a != b || c != 5);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: this boolean expression can be simplified
--> $DIR/nonminimal_bool.rs:28:13
help: try
|
LL | let _ = a == b || c == 5;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
LL | let _ = !(a != b && c != 5);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: this boolean expression can be simplified
--> $DIR/nonminimal_bool.rs:29:13
help: try
|
LL | let _ = a == b && c == 5;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
LL | let _ = !(a != b || c != 5);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: this boolean expression can be simplified
--> $DIR/nonminimal_bool.rs:30:13
help: try
|
LL | let _ = a != b || c != d;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
LL | let _ = !(a == b && c == d);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: this boolean expression can be simplified
--> $DIR/nonminimal_bool.rs:31:13
help: try
|
LL | let _ = a != b && c != d;
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
LL | let _ = !(a == b || c == d);
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to 12 previous errors
help: use the values directly
|
LL | let foo = 5 - 6;
- | ^ ^
+ | ~ ~
error: taken reference of right operand
--> $DIR/op_ref.rs:57:13
|
help: try
|
-LL | let _ = num.as_mut().map_or(&mut 0, |s| {
-LL | *s += 1;
-LL | s
-LL | });
+LL ~ let _ = num.as_mut().map_or(&mut 0, |s| {
+LL + *s += 1;
+LL + s
+LL ~ });
|
error: use Option::map_or instead of an if let/else
|
help: try
|
-LL | let _ = num.map_or(0, |mut s| {
-LL | s += 1;
-LL | s
-LL | });
+LL ~ let _ = num.map_or(0, |mut s| {
+LL + s += 1;
+LL + s
+LL ~ });
|
error: use Option::map_or instead of an if let/else
|
help: try
|
-LL | let _ = num.as_mut().map_or(&mut 0, |s| {
-LL | *s += 1;
-LL | s
-LL | });
+LL ~ let _ = num.as_mut().map_or(&mut 0, |s| {
+LL + *s += 1;
+LL + s
+LL ~ });
|
error: use Option::map_or instead of an if let/else
|
help: try
|
-LL | arg.map_or(13, |x| {
-LL | let y = x * x;
-LL | y * y
-LL | })
+LL ~ arg.map_or(13, |x| {
+LL + let y = x * x;
+LL + y * y
+LL + })
|
error: use Option::map_or_else instead of an if let/else
|
help: try
|
-LL | let _ = arg.map_or_else(|| {
-LL | let mut y = 1;
-LL | y = (y + 2 / y) / 2;
-LL | y = (y + 2 / y) / 2;
-LL | y
-LL | }, |x| x * x * x * x);
+LL ~ let _ = arg.map_or_else(|| {
+LL + let mut y = 1;
+LL + y = (y + 2 / y) / 2;
+LL + y = (y + 2 / y) / 2;
+LL + y
+LL ~ }, |x| x * x * x * x);
|
error: use Option::map_or instead of an if let/else
|
help: try using `and_then` instead
|
-LL | let _ = opt.and_then(|x| {
-LL | Some(x + 1)
-LL | });
+LL ~ let _ = opt.and_then(|x| {
+LL + Some(x + 1)
+LL ~ });
|
error: aborting due to 2 previous errors
= note: `-D clippy::print-literal` implied by `-D warnings`
help: try this
|
-LL | print!("Hello world");
- | ^^^^^--
+LL - print!("Hello {}", "world");
+LL + print!("Hello world");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:26:36
|
help: try this
|
-LL | println!("Hello {} world", world);
- | ^^^^^ --
+LL - println!("Hello {} {}", world, "world");
+LL + println!("Hello {} world", world);
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:27:26
|
help: try this
|
-LL | println!("Hello world");
- | ^^^^^--
+LL - println!("Hello {}", "world");
+LL + println!("Hello world");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:32:25
|
help: try this
|
-LL | println!("hello {1}", "world");
- | ^^^^^ --
+LL - println!("{0} {1}", "hello", "world");
+LL + println!("hello {1}", "world");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:32:34
|
help: try this
|
-LL | println!("{0} world", "hello");
- | ^^^^^ --
+LL - println!("{0} {1}", "hello", "world");
+LL + println!("{0} world", "hello");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:33:25
|
help: try this
|
-LL | println!("{1} hello", "world");
- | ^^^^^--
+LL - println!("{1} {0}", "hello", "world");
+LL + println!("{1} hello", "world");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:33:34
|
help: try this
|
-LL | println!("world {0}", "hello");
- | ^^^^^ --
+LL - println!("{1} {0}", "hello", "world");
+LL + println!("world {0}", "hello");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:36:29
|
help: try this
|
-LL | println!("hello {bar}", bar = "world");
- | ^^^^^ --
+LL - println!("{foo} {bar}", foo = "hello", bar = "world");
+LL + println!("hello {bar}", bar = "world");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:36:44
|
help: try this
|
-LL | println!("{foo} world", foo = "hello");
- | ^^^^^ --
+LL - println!("{foo} {bar}", foo = "hello", bar = "world");
+LL + println!("{foo} world", foo = "hello");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:37:29
|
help: try this
|
-LL | println!("{bar} hello", bar = "world");
- | ^^^^^--
+LL - println!("{bar} {foo}", foo = "hello", bar = "world");
+LL + println!("{bar} hello", bar = "world");
+ |
error: literal with an empty format string
--> $DIR/print_literal.rs:37:44
|
help: try this
|
-LL | println!("world {foo}", foo = "hello");
- | ^^^^^ --
+LL - println!("{bar} {foo}", foo = "hello", bar = "world");
+LL + println!("world {foo}", foo = "hello");
+ |
error: aborting due to 11 previous errors
= note: `-D clippy::print-with-newline` implied by `-D warnings`
help: use `println!` instead
|
-LL | println!("Hello");
- | ^^^^^^^ --
+LL - print!("Hello/n");
+LL + println!("Hello");
+ |
error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:9:5
|
help: use `println!` instead
|
-LL | println!("Hello {}", "world");
- | ^^^^^^^ --
+LL - print!("Hello {}/n", "world");
+LL + println!("Hello {}", "world");
+ |
error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:10:5
|
help: use `println!` instead
|
-LL | println!("Hello {} {}", "world", "#2");
- | ^^^^^^^ --
+LL - print!("Hello {} {}/n", "world", "#2");
+LL + println!("Hello {} {}", "world", "#2");
+ |
error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:11:5
|
help: use `println!` instead
|
-LL | println!("{}", 1265);
- | ^^^^^^^ --
+LL - print!("{}/n", 1265);
+LL + println!("{}", 1265);
+ |
error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:12:5
|
help: use `println!` instead
|
-LL | println!();
- | ^^^^^^^ --
+LL - print!("/n");
+LL + println!();
+ |
error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:31:5
|
help: use `println!` instead
|
-LL | println!("/"); // should fail
- | ^^^^^^^ --
+LL - print!("//n"); // should fail
+LL + println!("/"); // should fail
+ |
error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:38:5
|
help: use `println!` instead
|
-LL | println!(
-LL | ""
+LL ~ println!(
+LL ~ ""
|
error: using `print!()` with a format string that ends in a single newline
|
help: use `println!` instead
|
-LL | println!(
-LL | r""
+LL ~ println!(
+LL ~ r""
|
error: using `print!()` with a format string that ends in a single newline
|
help: use `println!` instead
|
-LL | println!("/r"); //~ ERROR
- | ^^^^^^^ --
+LL - print!("/r/n"); //~ ERROR
+LL + println!("/r"); //~ ERROR
+ |
error: using `print!()` with a format string that ends in a single newline
--> $DIR/print_with_newline.rs:51:5
|
help: use `println!` instead
|
-LL | println!("foo/rbar") // ~ ERROR
- | ^^^^^^^ --
+LL - print!("foo/rbar/n") // ~ ERROR
+LL + println!("foo/rbar") // ~ ERROR
+ |
error: aborting due to 10 previous errors
help: change this to
|
LL | fn cloned(x: &[u8]) -> Vec<u8> {
- | ^^^^^
+ | ~~~~~
help: change `x.clone()` to
|
LL | let e = x.to_owned();
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
help: change `x.clone()` to
|
LL | x.to_owned()
help: change this to
|
LL | fn str_cloned(x: &str) -> String {
- | ^^^^
+ | ~~~~
help: change `x.clone()` to
|
LL | let a = x.to_string();
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: change `x.clone()` to
|
LL | let b = x.to_string();
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: change `x.clone()` to
|
LL | x.to_string()
help: change this to
|
LL | fn path_cloned(x: &Path) -> PathBuf {
- | ^^^^^
+ | ~~~~~
help: change `x.clone()` to
|
LL | let a = x.to_path_buf();
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: change `x.clone()` to
|
LL | let b = x.to_path_buf();
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: change `x.clone()` to
|
LL | x.to_path_buf()
help: change this to
|
LL | fn false_positive_capacity(x: &Vec<u8>, y: &str) {
- | ^^^^
+ | ~~~~
help: change `y.clone()` to
|
LL | let b = y.to_string();
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: change `y.as_str()` to
|
LL | let c = y;
- | ^
+ | ~
error: using a reference to `Cow` is not recommended
--> $DIR/ptr_arg.rs:90:25
help: change this to
|
LL | fn foo_vec(vec: &[u8]) {
- | ^^^^^
+ | ~~~~~
help: change `vec.clone()` to
|
LL | let _ = vec.to_owned().pop();
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
help: change `vec.clone()` to
|
LL | let _ = vec.to_owned().clone();
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> $DIR/ptr_arg.rs:148:23
help: change this to
|
LL | fn foo_path(path: &Path) {
- | ^^^^^
+ | ~~~~~
help: change `path.clone()` to
|
LL | let _ = path.to_path_buf().pop();
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
help: change `path.clone()` to
|
LL | let _ = path.to_path_buf().clone();
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: writing `&PathBuf` instead of `&Path` involves a new object where a slice will do
--> $DIR/ptr_arg.rs:153:21
help: change this to
|
LL | fn foo_str(str: &Path) {
- | ^^^^^
+ | ~~~~~
help: change `str.clone()` to
|
LL | let _ = str.to_path_buf().pop();
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
help: change `str.clone()` to
|
LL | let _ = str.to_path_buf().clone();
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: aborting due to 12 previous errors
help: try this
|
LL | Some(x) => &x,
- | ^ ^^
+ | ~ ~~
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:37:14
|
help: try this
|
-LL | Some(x) => {
+LL ~ Some(x) => {
LL | f1(x);
-LL | f1(x);
-LL | &x
+LL ~ f1(x);
+LL ~ &x
|
error: this pattern creates a reference to a reference
help: try this
|
LL | Some(x) => m2!(&x),
- | ^ ^^
+ | ~ ~~
error: this pattern creates a reference to a reference
--> $DIR/ref_binding_to_reference.rs:52:15
|
help: try this
|
-LL | let _ = |&x: &&String| {
-LL | let _: &&String = &x;
+LL ~ let _ = |&x: &&String| {
+LL ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
|
help: try this
|
-LL | fn f2<'a>(&x: &&'a String) -> &'a String {
-LL | let _: &&String = &x;
-LL | x
+LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
+LL ~ let _: &&String = &x;
+LL ~ x
|
error: this pattern creates a reference to a reference
|
help: try this
|
-LL | fn f(&x: &&String) {
-LL | let _: &&String = &x;
+LL ~ fn f(&x: &&String) {
+LL ~ let _: &&String = &x;
|
error: this pattern creates a reference to a reference
|
help: try this
|
-LL | fn f(&x: &&String) {
-LL | let _: &&String = &x;
+LL ~ fn f(&x: &&String) {
+LL ~ let _: &&String = &x;
|
error: aborting due to 7 previous errors
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | (21..=42).rev().for_each(|x| println!("{}", x));
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_fixable.rs:10:13
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | let _ = (21..ANSWER).rev().filter(|x| x % 2 == 0).take(10).collect::<Vec<_>>();
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_fixable.rs:12:14
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for _ in (-42..=-21).rev() {}
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_fixable.rs:13:14
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for _ in (21u32..42u32).rev() {}
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (0..10).rev() {
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_loops_fixable.rs:11:14
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (0..=10).rev() {
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_loops_fixable.rs:15:14
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (0..MAX_LEN).rev() {
- | ^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_loops_fixable.rs:34:14
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (0..10).rev().map(|x| x * 2) {
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_loops_fixable.rs:39:14
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in (5 + 4..10).rev() {
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: this range is empty so it will yield no values
--> $DIR/reversed_empty_ranges_loops_fixable.rs:43:14
help: consider using the following if you are attempting to iterate over this range in reverse
|
LL | for i in ((3 - 1)..(5 + 2)).rev() {
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors
= note: `-D clippy::single-element-loop` implied by `-D warnings`
help: try
|
-LL | {
-LL | let item = &item1;
-LL | println!("{}", item);
-LL | }
+LL ~ {
+LL + let item = &item1;
+LL + println!("{}", item);
+LL + }
|
error: for loop over a single element
|
help: try
|
-LL | {
-LL | let item = &item1;
-LL | println!("{:?}", item);
-LL | }
+LL ~ {
+LL + let item = &item1;
+LL + println!("{:?}", item);
+LL + }
|
error: aborting due to 2 previous errors
= note: `-D clippy::single-match` implied by `-D warnings`
help: try this
|
-LL | if let Some(y) = x {
-LL | println!("{:?}", y);
-LL | };
+LL ~ if let Some(y) = x {
+LL + println!("{:?}", y);
+LL ~ };
|
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
= note: `-D clippy::single-match-else` implied by `-D warnings`
help: try this
|
-LL | if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else {
-LL | let x = 5;
-LL | None
-LL | }
+LL ~ if let ExprNode::ExprAddrOf = ExprNode::Butterflies { Some(&NODE) } else {
+LL + let x = 5;
+LL + None
+LL + }
|
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
|
help: try this
|
-LL | if let Some(a) = Some(1) { println!("${:?}", a) } else {
-LL | println!("else block");
-LL | return
-LL | }
+LL ~ if let Some(a) = Some(1) { println!("${:?}", a) } else {
+LL + println!("else block");
+LL + return
+LL + }
|
error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let`
|
help: try this
|
-LL | if let Some(a) = Some(1) { println!("${:?}", a) } else {
-LL | println!("else block");
-LL | return;
-LL | }
+LL ~ if let Some(a) = Some(1) { println!("${:?}", a) } else {
+LL + println!("else block");
+LL + return;
+LL + }
|
error: aborting due to 3 previous errors
help: try this (you might also need to get rid of `unsafe` block in some cases):
|
LL | let len = unsafe { cstring.as_bytes().len() };
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: using `libc::strlen` on a `CString` or `CStr` value
--> $DIR/strlen_on_c_strings.rs:15:24
help: try this (you might also need to get rid of `unsafe` block in some cases):
|
LL | let len = unsafe { cstr.to_bytes().len() };
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
-LL | {
-LL | 1;
-LL | };
-LL | foo(());
+LL ~ {
+LL + 1;
+LL + };
+LL ~ foo(());
|
error: passing a unit value to a function
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
-LL | foo(1);
-LL | foo(());
+LL ~ foo(1);
+LL ~ foo(());
|
error: passing a unit value to a function
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
-LL | {
-LL | foo(1);
-LL | foo(2);
-LL | };
-LL | foo(());
+LL ~ {
+LL + foo(1);
+LL + foo(2);
+LL + };
+LL ~ foo(());
|
error: passing a unit value to a function
|
help: or move the expression in front of the call and replace it with the unit literal `()`
|
-LL | {
-LL | 1;
-LL | };
-LL | b.bar(());
+LL ~ {
+LL + 1;
+LL + };
+LL ~ b.bar(());
|
error: passing unit values to a function
|
help: move the expressions in front of the call and replace them with the unit literal `()`
|
-LL | foo(0);
-LL | foo(1);
-LL | taking_multiple_units((), ());
+LL ~ foo(0);
+LL + foo(1);
+LL ~ taking_multiple_units((), ());
|
error: passing unit values to a function
|
help: or move the expressions in front of the call and replace them with the unit literal `()`
|
-LL | foo(0);
-LL | {
-LL | foo(1);
-LL | foo(2);
-LL | };
-LL | taking_multiple_units((), ());
+LL ~ foo(0);
+LL + {
+LL + foo(1);
+LL + foo(2);
+LL + };
+LL ~ taking_multiple_units((), ());
|
error: passing unit values to a function
|
help: or move the expressions in front of the call and replace them with the unit literal `()`
|
-LL | {
-LL | foo(0);
-LL | foo(1);
-LL | };
-LL | {
-LL | foo(2);
+LL ~ {
+LL + foo(0);
+LL + foo(1);
+LL + };
+LL + {
+LL + foo(2);
...
error: passing a unit value to a function
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
-LL | None.or({
-LL | foo(2);
-LL | Some(())
-LL | });
+LL ~ None.or({
+LL + foo(2);
+LL + Some(())
+LL ~ });
|
error: passing a unit value to a function
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
-LL | foo(());
-LL | foo(());
+LL ~ foo(());
+LL ~ foo(());
|
error: passing a unit value to a function
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
-LL | foo(1);
-LL | Some(())
+LL ~ foo(1);
+LL + Some(())
|
error: aborting due to 10 previous errors
|
help: move the expression in front of the call and replace it with the unit literal `()`
|
-LL | foo(0);
-LL | taking_two_units((), ());
+LL ~ foo(0);
+LL ~ taking_two_units((), ());
|
error: passing unit values to a function
|
help: move the expressions in front of the call and replace them with the unit literal `()`
|
-LL | foo(0);
-LL | foo(1);
-LL | taking_three_units((), (), ());
+LL ~ foo(0);
+LL + foo(1);
+LL ~ taking_three_units((), (), ());
|
error: aborting due to 4 previous errors
help: try dereferencing it
|
LL | let z: &Vec<_> = &(*y).clone();
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
help: or try being explicit if you are sure, that you want to clone a reference
|
LL | let z: &Vec<_> = <&std::vec::Vec<i32>>::clone(y);
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: using `clone` on type `many_derefs::E` which implements the `Copy` trait
--> $DIR/unnecessary_clone.rs:84:20
help: try dereferencing it
|
LL | let _ = &mut &(*encoded).clone();
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
help: or try being explicit if you are sure, that you want to clone a reference
|
LL | let _ = &mut <&[u8]>::clone(encoded);
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: using `clone` on a double-reference; this will copy the reference of type `&[u8]` instead of cloning the inner type
--> $DIR/unnecessary_clone.rs:90:18
help: try dereferencing it
|
LL | let _ = &&(*encoded).clone();
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
help: or try being explicit if you are sure, that you want to clone a reference
|
LL | let _ = &<&[u8]>::clone(encoded);
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: using `.clone()` on a ref-counted pointer
--> $DIR/unnecessary_clone.rs:108:14
help: remove `Option` from the return type...
|
LL | fn func1(a: bool, b: bool) -> i32 {
- | ^^^
+ | ~~~
help: ...and then change returning expressions
|
-LL | return 42;
+LL ~ return 42;
LL | }
LL | if a {
LL | Some(-1);
-LL | 2
+LL ~ 2
LL | } else {
...
help: remove `Option` from the return type...
|
LL | fn func2(a: bool, b: bool) -> i32 {
- | ^^^
+ | ~~~
help: ...and then change returning expressions
|
-LL | return 10;
+LL ~ return 10;
LL | }
-LL | if a { 20 } else { 30 }
+LL ~ if a { 20 } else { 30 }
|
error: this function's return value is unnecessarily wrapped by `Option`
help: remove `Option` from the return type...
|
LL | fn func5() -> i32 {
- | ^^^
+ | ~~~
help: ...and then change returning expressions
|
LL | 1
help: remove `Result` from the return type...
|
LL | fn func7() -> i32 {
- | ^^^
+ | ~~~
help: ...and then change returning expressions
|
LL | 1
help: remove `Option` from the return type...
|
LL | fn func12() -> i32 {
- | ^^^
+ | ~~~
help: ...and then change returning expressions
|
LL | 1
help: remove the return type...
|
LL | fn issue_6640_1(a: bool, b: bool) -> Option<()> {
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
help: ...and then remove returned values
|
-LL | return ;
+LL ~ return ;
LL | }
LL | if a {
LL | Some(());
-LL |
+LL ~
LL | } else {
...
help: remove the return type...
|
LL | fn issue_6640_2(a: bool, b: bool) -> Result<(), i32> {
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
help: ...and then remove returned values
|
-LL | return ;
+LL ~ return ;
LL | }
LL | if a {
-LL |
+LL ~
LL | } else {
-LL | return ;
+LL ~ return ;
|
error: aborting due to 7 previous errors
help: nest the patterns
|
LL | if let box (0 | 2) = Box::new(0) {}
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:10:12
help: nest the patterns
|
LL | if let box (0 | 1 | 2 | 3 | 4) = Box::new(0) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:12:12
help: nest the patterns
|
LL | if let &(0 | 2) | C0 = &0 {}
- | ^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:13:12
help: nest the patterns
|
LL | if let &mut (0 | 2) = &mut 0 {}
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:14:12
help: nest the patterns
|
LL | if let x @ (0 | 2) = 0 {}
- | ^^^^^^^^^^^
+ | ~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:15:12
help: nest the patterns
|
LL | if let (0, 1 | 2 | 3) = (0, 0) {}
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:16:12
help: nest the patterns
|
LL | if let (1 | 2 | 3, 0) = (0, 0) {}
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:17:12
help: nest the patterns
|
LL | if let (x, ..) | (x, 1 | 2) = (0, 1) {}
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:18:12
help: nest the patterns
|
LL | if let [0 | 1] = [0] {}
- | ^^^^^^^
+ | ~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:19:12
help: nest the patterns
|
LL | if let [x, 0 | 1] = [0, 1] {}
- | ^^^^^^^^^^
+ | ~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:20:12
help: nest the patterns
|
LL | if let [x, 0 | 1 | 2] = [0, 1] {}
- | ^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:21:12
help: nest the patterns
|
LL | if let [x, ..] | [x, 1 | 2] = [0, 1] {}
- | ^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:23:12
help: nest the patterns
|
LL | if let TS(0 | 1, x) = TS(0, 0) {}
- | ^^^^^^^^^^^^
+ | ~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:24:12
help: nest the patterns
|
LL | if let TS(1 | 2 | 3, 0) = TS(0, 0) {}
- | ^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:25:12
help: nest the patterns
|
LL | if let TS(x, ..) | TS(x, 1 | 2) = TS(0, 0) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns.rs:30:12
help: nest the patterns
|
LL | if let S { x: 0 | 1, y } = (S { x: 0, y: 1 }) {}
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: aborting due to 16 previous errors
help: nest the patterns
|
LL | if let Some(Some(0 | 1)) = None {}
- | ^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns2.rs:10:12
help: nest the patterns
|
LL | if let Some(Some(0 | 1 | 2)) = None {}
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns2.rs:11:12
help: nest the patterns
|
LL | if let Some(Some(0 | 1 | 2 | 3 | 4)) = None {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns2.rs:12:12
help: nest the patterns
|
LL | if let Some(Some(0 | 1 | 2)) = None {}
- | ^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns2.rs:13:12
help: nest the patterns
|
LL | if let ((0 | 1 | 2,),) = ((0,),) {}
- | ^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns2.rs:14:12
help: nest the patterns
|
LL | if let 0 | 1 | 2 = 0 {}
- | ^^^^^^^^^
+ | ~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns2.rs:15:12
help: nest the patterns
|
LL | if let box (0 | 1 | 2 | 3 | 4) = Box::new(0) {}
- | ^^^^^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~~~~~
error: unnested or-patterns
--> $DIR/unnested_or_patterns2.rs:16:12
help: nest the patterns
|
LL | if let box box (0 | 2 | 4) = Box::new(Box::new(0)) {}
- | ^^^^^^^^^^^^^^^^^^^
+ | ~~~~~~~~~~~~~~~~~~~
error: aborting due to 8 previous errors
= note: `-D clippy::write-literal` implied by `-D warnings`
help: try this
|
-LL | write!(&mut v, "Hello world");
- | ^^^^^--
+LL - write!(&mut v, "Hello {}", "world");
+LL + write!(&mut v, "Hello world");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:31:44
|
help: try this
|
-LL | writeln!(&mut v, "Hello {} world", world);
- | ^^^^^ --
+LL - writeln!(&mut v, "Hello {} {}", world, "world");
+LL + writeln!(&mut v, "Hello {} world", world);
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:32:34
|
help: try this
|
-LL | writeln!(&mut v, "Hello world");
- | ^^^^^--
+LL - writeln!(&mut v, "Hello {}", "world");
+LL + writeln!(&mut v, "Hello world");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:37:33
|
help: try this
|
-LL | writeln!(&mut v, "hello {1}", "world");
- | ^^^^^ --
+LL - writeln!(&mut v, "{0} {1}", "hello", "world");
+LL + writeln!(&mut v, "hello {1}", "world");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:37:42
|
help: try this
|
-LL | writeln!(&mut v, "{0} world", "hello");
- | ^^^^^ --
+LL - writeln!(&mut v, "{0} {1}", "hello", "world");
+LL + writeln!(&mut v, "{0} world", "hello");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:38:33
|
help: try this
|
-LL | writeln!(&mut v, "{1} hello", "world");
- | ^^^^^--
+LL - writeln!(&mut v, "{1} {0}", "hello", "world");
+LL + writeln!(&mut v, "{1} hello", "world");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:38:42
|
help: try this
|
-LL | writeln!(&mut v, "world {0}", "hello");
- | ^^^^^ --
+LL - writeln!(&mut v, "{1} {0}", "hello", "world");
+LL + writeln!(&mut v, "world {0}", "hello");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:41:37
|
help: try this
|
-LL | writeln!(&mut v, "hello {bar}", bar = "world");
- | ^^^^^ --
+LL - writeln!(&mut v, "{foo} {bar}", foo = "hello", bar = "world");
+LL + writeln!(&mut v, "hello {bar}", bar = "world");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:41:52
|
help: try this
|
-LL | writeln!(&mut v, "{foo} world", foo = "hello");
- | ^^^^^ --
+LL - writeln!(&mut v, "{foo} {bar}", foo = "hello", bar = "world");
+LL + writeln!(&mut v, "{foo} world", foo = "hello");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:42:37
|
help: try this
|
-LL | writeln!(&mut v, "{bar} hello", bar = "world");
- | ^^^^^--
+LL - writeln!(&mut v, "{bar} {foo}", foo = "hello", bar = "world");
+LL + writeln!(&mut v, "{bar} hello", bar = "world");
+ |
error: literal with an empty format string
--> $DIR/write_literal.rs:42:52
|
help: try this
|
-LL | writeln!(&mut v, "world {foo}", foo = "hello");
- | ^^^^^ --
+LL - writeln!(&mut v, "{bar} {foo}", foo = "hello", bar = "world");
+LL + writeln!(&mut v, "world {foo}", foo = "hello");
+ |
error: aborting due to 11 previous errors
= note: `-D clippy::write-literal` implied by `-D warnings`
help: try this
|
-LL | writeln!(&mut v, "{{hello}}");
- | ^^^^^^^^^--
+LL - writeln!(&mut v, "{}", "{hello}");
+LL + writeln!(&mut v, "{{hello}}");
+ |
error: literal with an empty format string
--> $DIR/write_literal_2.rs:10:29
|
help: try this
|
-LL | writeln!(&mut v, r"{{hello}}");
- | ^^^^^^^^^--
+LL - writeln!(&mut v, r"{}", r"{hello}");
+LL + writeln!(&mut v, r"{{hello}}");
+ |
error: literal with an empty format string
--> $DIR/write_literal_2.rs:11:28
|
help: try this
|
-LL | writeln!(&mut v, "'");
- | ^--
+LL - writeln!(&mut v, "{}", '/'');
+LL + writeln!(&mut v, "'");
+ |
error: literal with an empty format string
--> $DIR/write_literal_2.rs:12:28
|
help: try this
|
-LL | writeln!(&mut v, "/"");
- | ^^--
+LL - writeln!(&mut v, "{}", '"');
+LL + writeln!(&mut v, "/"");
+ |
error: literal with an empty format string
--> $DIR/write_literal_2.rs:14:29
|
help: try this
|
-LL | writeln!(&mut v, r"'");
- | ^--
+LL - writeln!(&mut v, r"{}", '/'');
+LL + writeln!(&mut v, r"'");
+ |
error: literal with an empty format string
--> $DIR/write_literal_2.rs:18:9
|
help: try this
|
-LL | "some hello /
-LL | world!"
+LL ~ "some hello /
+LL ~ world!"
|
error: literal with an empty format string
|
help: try this
|
-LL | "some 1/
-LL | {} / {}", "2", "3",
+LL ~ "some 1/
+LL ~ {} / {}", "2", "3",
|
error: literal with an empty format string
|
help: try this
|
-LL | 2 / {}",
-LL | "1", "3",
+LL ~ 2 / {}",
+LL ~ "1", "3",
|
error: literal with an empty format string
|
help: try this
|
-LL | {} / 3",
-LL | "1", "2",
+LL ~ {} / 3",
+LL ~ "1", "2",
|
error: aborting due to 9 previous errors
= note: `-D clippy::write-with-newline` implied by `-D warnings`
help: use `writeln!()` instead
|
-LL | writeln!(&mut v, "Hello");
- | ^^^^^^^ --
+LL - write!(&mut v, "Hello/n");
+LL + writeln!(&mut v, "Hello");
+ |
error: using `write!()` with a format string that ends in a single newline
--> $DIR/write_with_newline.rs:14:5
|
help: use `writeln!()` instead
|
-LL | writeln!(&mut v, "Hello {}", "world");
- | ^^^^^^^ --
+LL - write!(&mut v, "Hello {}/n", "world");
+LL + writeln!(&mut v, "Hello {}", "world");
+ |
error: using `write!()` with a format string that ends in a single newline
--> $DIR/write_with_newline.rs:15:5
|
help: use `writeln!()` instead
|
-LL | writeln!(&mut v, "Hello {} {}", "world", "#2");
- | ^^^^^^^ --
+LL - write!(&mut v, "Hello {} {}/n", "world", "#2");
+LL + writeln!(&mut v, "Hello {} {}", "world", "#2");
+ |
error: using `write!()` with a format string that ends in a single newline
--> $DIR/write_with_newline.rs:16:5
|
help: use `writeln!()` instead
|
-LL | writeln!(&mut v, "{}", 1265);
- | ^^^^^^^ --
+LL - write!(&mut v, "{}/n", 1265);
+LL + writeln!(&mut v, "{}", 1265);
+ |
error: using `write!()` with a format string that ends in a single newline
--> $DIR/write_with_newline.rs:17:5
|
help: use `writeln!()` instead
|
-LL | writeln!(&mut v);
- | ^^^^^^^ --
+LL - write!(&mut v, "/n");
+LL + writeln!(&mut v);
+ |
error: using `write!()` with a format string that ends in a single newline
--> $DIR/write_with_newline.rs:36:5
|
help: use `writeln!()` instead
|
-LL | writeln!(&mut v, "/"); // should fail
- | ^^^^^^^ --
+LL - write!(&mut v, "//n"); // should fail
+LL + writeln!(&mut v, "/"); // should fail
+ |
error: using `write!()` with a format string that ends in a single newline
--> $DIR/write_with_newline.rs:43:5
|
help: use `writeln!()` instead
|
-LL | writeln!(
+LL ~ writeln!(
LL | &mut v,
-LL | ""
+LL ~ ""
|
error: using `write!()` with a format string that ends in a single newline
|
help: use `writeln!()` instead
|
-LL | writeln!(
+LL ~ writeln!(
LL | &mut v,
-LL | r""
+LL ~ r""
|
error: using `write!()` with a format string that ends in a single newline
|
help: use `writeln!()` instead
|
-LL | writeln!(&mut v, "/r"); //~ ERROR
- | ^^^^^^^ --
+LL - write!(&mut v, "/r/n"); //~ ERROR
+LL + writeln!(&mut v, "/r"); //~ ERROR
+ |
error: using `write!()` with a format string that ends in a single newline
--> $DIR/write_with_newline.rs:58:5
|
help: use `writeln!()` instead
|
-LL | writeln!(&mut v, "foo/rbar");
- | ^^^^^^^ --
+LL - write!(&mut v, "foo/rbar/n");
+LL + writeln!(&mut v, "foo/rbar");
+ |
error: aborting due to 10 previous errors
-Subproject commit ea105f9396a9dab68e71efb06016b7c76c83ba7c
+Subproject commit 5664a2b0b31403024ce5ab927760d630d5ddc9a4
// will blow up. Template strings are not tested and might also be
// broken.
function extractFunction(content, functionName) {
- var indent = 0;
+ var level = 0;
var splitter = "function " + functionName + "(";
+ var stop;
+ var pos, start;
while (true) {
- var start = content.indexOf(splitter);
+ start = content.indexOf(splitter);
if (start === -1) {
break;
}
- var pos = start;
+ pos = start;
while (pos < content.length && content[pos] !== ')') {
pos += 1;
}
}
while (pos < content.length) {
// Eat single-line comments
- if (content[pos] === '/' && pos > 0 && content[pos-1] === '/') {
+ if (content[pos] === '/' && pos > 0 && content[pos - 1] === '/') {
do {
pos += 1;
} while (pos < content.length && content[pos] !== '\n');
+ // Eat multiline comment.
+ } else if (content[pos] === '*' && pos > 0 && content[pos - 1] === '/') {
+ do {
+ pos += 1;
+ } while (pos < content.length && content[pos] !== '/' && content[pos - 1] !== '*');
+
// Eat quoted strings
} else if (content[pos] === '"' || content[pos] === "'" || content[pos] === "`") {
- var stop = content[pos];
- var is_escaped = false;
+ stop = content[pos];
do {
if (content[pos] === '\\') {
- pos += 2;
- } else {
pos += 1;
}
- } while (pos < content.length &&
- (content[pos] !== stop || content[pos - 1] === '\\'));
+ pos += 1;
+ } while (pos < content.length && content[pos] !== stop);
- // Otherwise, check for indent
+ // Otherwise, check for block level.
} else if (content[pos] === '{') {
- indent += 1;
+ level += 1;
} else if (content[pos] === '}') {
- indent -= 1;
- if (indent === 0) {
+ level -= 1;
+ if (level === 0) {
return content.slice(start, pos + 1);
}
}