Rollup merge of #105411 - estebank:short-names, r=oli-obk

Introduce `with_forced_trimmed_paths`

Built on top of https://github.com/rust-lang/rust/pull/104922, only last commit is relevant.
This commit is contained in:
Matthias Krüger 2022-12-11 09:51:56 +01:00 committed by GitHub
commit cb4753135e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
40 changed files with 225 additions and 119 deletions

View File

@ -1,6 +1,6 @@
use crate::traits::{ObligationCause, ObligationCauseCode};
use crate::ty::diagnostics::suggest_constraining_type_param;
use crate::ty::print::{FmtPrinter, Printer};
use crate::ty::print::{with_forced_trimmed_paths, FmtPrinter, Printer};
use crate::ty::{self, BoundRegionKind, Region, Ty, TyCtxt};
use hir::def::DefKind;
use rustc_errors::Applicability::{MachineApplicable, MaybeIncorrect};
@ -162,17 +162,29 @@ impl<'tcx> fmt::Display for TypeError<'tcx> {
),
RegionsPlaceholderMismatch => write!(f, "one type is more general than the other"),
ArgumentSorts(values, _) | Sorts(values) => ty::tls::with(|tcx| {
report_maybe_different(
f,
&values.expected.sort_string(tcx),
&values.found.sort_string(tcx),
)
let (mut expected, mut found) = with_forced_trimmed_paths!((
values.expected.sort_string(tcx),
values.found.sort_string(tcx),
));
if expected == found {
expected = values.expected.sort_string(tcx);
found = values.found.sort_string(tcx);
}
report_maybe_different(f, &expected, &found)
}),
Traits(values) => ty::tls::with(|tcx| {
let (mut expected, mut found) = with_forced_trimmed_paths!((
tcx.def_path_str(values.expected),
tcx.def_path_str(values.found),
));
if expected == found {
expected = tcx.def_path_str(values.expected);
found = tcx.def_path_str(values.found);
}
report_maybe_different(
f,
&format!("trait `{}`", tcx.def_path_str(values.expected)),
&format!("trait `{}`", tcx.def_path_str(values.found)),
&format!("trait `{expected}`"),
&format!("trait `{found}`"),
)
}),
IntMismatch(ref values) => {
@ -999,14 +1011,16 @@ fn foo(&self) -> Self::T { String::new() }
let mut short;
loop {
// Look for the longest properly trimmed path that still fits in lenght_limit.
short = FmtPrinter::new_with_limit(
self,
hir::def::Namespace::TypeNS,
rustc_session::Limit(type_limit),
)
.pretty_print_type(ty)
.expect("could not write to `String`")
.into_buffer();
short = with_forced_trimmed_paths!(
FmtPrinter::new_with_limit(
self,
hir::def::Namespace::TypeNS,
rustc_session::Limit(type_limit),
)
.pretty_print_type(ty)
.expect("could not write to `String`")
.into_buffer()
);
if short.len() <= length_limit || type_limit == 0 {
break;
}

View File

@ -10,7 +10,7 @@ use rustc_data_structures::sso::SsoHashSet;
use rustc_hir as hir;
use rustc_hir::def::{self, CtorKind, DefKind, Namespace};
use rustc_hir::def_id::{DefId, DefIdSet, CRATE_DEF_ID, LOCAL_CRATE};
use rustc_hir::definitions::{DefPathData, DefPathDataName, DisambiguatedDefPathData};
use rustc_hir::definitions::{DefKey, DefPathData, DefPathDataName, DisambiguatedDefPathData};
use rustc_hir::LangItem;
use rustc_session::config::TrimmedDefPaths;
use rustc_session::cstore::{ExternCrate, ExternCrateSource};
@ -63,6 +63,7 @@ thread_local! {
static FORCE_IMPL_FILENAME_LINE: Cell<bool> = const { Cell::new(false) };
static SHOULD_PREFIX_WITH_CRATE: Cell<bool> = const { Cell::new(false) };
static NO_TRIMMED_PATH: Cell<bool> = const { Cell::new(false) };
static FORCE_TRIMMED_PATH: Cell<bool> = const { Cell::new(false) };
static NO_QUERIES: Cell<bool> = const { Cell::new(false) };
static NO_VISIBLE_PATH: Cell<bool> = const { Cell::new(false) };
}
@ -116,6 +117,7 @@ define_helper!(
/// of various rustc types, for example `std::vec::Vec` would be trimmed to `Vec`,
/// if no other `Vec` is found.
fn with_no_trimmed_paths(NoTrimmedGuard, NO_TRIMMED_PATH);
fn with_forced_trimmed_paths(ForceTrimmedGuard, FORCE_TRIMMED_PATH);
/// Prevent selection of visible paths. `Display` impl of DefId will prefer
/// visible (public) reexports of types as paths.
fn with_no_visible_paths(NoVisibleGuard, NO_VISIBLE_PATH);
@ -295,11 +297,89 @@ pub trait PrettyPrinter<'tcx>:
self.try_print_visible_def_path_recur(def_id, &mut callers)
}
// Given a `DefId`, produce a short name. For types and traits, it prints *only* its name,
// For associated items on traits it prints out the trait's name and the associated item's name.
// For enum variants, if they have an unique name, then we only print the name, otherwise we
// print the enum name and the variant name. Otherwise, we do not print anything and let the
// caller use the `print_def_path` fallback.
fn force_print_trimmed_def_path(
mut self,
def_id: DefId,
) -> Result<(Self::Path, bool), Self::Error> {
let key = self.tcx().def_key(def_id);
let visible_parent_map = self.tcx().visible_parent_map(());
let kind = self.tcx().def_kind(def_id);
let get_local_name = |this: &Self, name, def_id, key: DefKey| {
if let Some(visible_parent) = visible_parent_map.get(&def_id)
&& let actual_parent = this.tcx().opt_parent(def_id)
&& let DefPathData::TypeNs(_) = key.disambiguated_data.data
&& Some(*visible_parent) != actual_parent
{
this
.tcx()
.module_children(visible_parent)
.iter()
.filter(|child| child.res.opt_def_id() == Some(def_id))
.find(|child| child.vis.is_public() && child.ident.name != kw::Underscore)
.map(|child| child.ident.name)
.unwrap_or(name)
} else {
name
}
};
if let DefKind::Variant = kind
&& let Some(symbol) = self.tcx().trimmed_def_paths(()).get(&def_id)
{
// If `Assoc` is unique, we don't want to talk about `Trait::Assoc`.
self.write_str(get_local_name(&self, *symbol, def_id, key).as_str())?;
return Ok((self, true));
}
if let Some(symbol) = key.get_opt_name() {
if let DefKind::AssocConst | DefKind::AssocFn | DefKind::AssocTy = kind
&& let Some(parent) = self.tcx().opt_parent(def_id)
&& let parent_key = self.tcx().def_key(parent)
&& let Some(symbol) = parent_key.get_opt_name()
{
// Trait
self.write_str(get_local_name(&self, symbol, parent, parent_key).as_str())?;
self.write_str("::")?;
} else if let DefKind::Variant = kind
&& let Some(parent) = self.tcx().opt_parent(def_id)
&& let parent_key = self.tcx().def_key(parent)
&& let Some(symbol) = parent_key.get_opt_name()
{
// Enum
// For associated items and variants, we want the "full" path, namely, include
// the parent type in the path. For example, `Iterator::Item`.
self.write_str(get_local_name(&self, symbol, parent, parent_key).as_str())?;
self.write_str("::")?;
} else if let DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::Trait
| DefKind::TyAlias | DefKind::Fn | DefKind::Const | DefKind::Static(_) = kind
{
} else {
// If not covered above, like for example items out of `impl` blocks, fallback.
return Ok((self, false));
}
self.write_str(get_local_name(&self, symbol, def_id, key).as_str())?;
return Ok((self, true));
}
Ok((self, false))
}
/// Try to see if this path can be trimmed to a unique symbol name.
fn try_print_trimmed_def_path(
mut self,
def_id: DefId,
) -> Result<(Self::Path, bool), Self::Error> {
if FORCE_TRIMMED_PATH.with(|flag| flag.get()) {
let (s, trimmed) = self.force_print_trimmed_def_path(def_id)?;
if trimmed {
return Ok((s, true));
}
self = s;
}
if !self.tcx().sess.opts.unstable_opts.trim_diagnostic_paths
|| matches!(self.tcx().sess.opts.trimmed_def_paths, TrimmedDefPaths::Never)
|| NO_TRIMMED_PATH.with(|flag| flag.get())

View File

@ -36,7 +36,7 @@ use std::fmt;
use super::InferCtxtPrivExt;
use crate::infer::InferCtxtExt as _;
use crate::traits::query::evaluate_obligation::InferCtxtExt as _;
use rustc_middle::ty::print::with_no_trimmed_paths;
use rustc_middle::ty::print::{with_forced_trimmed_paths, with_no_trimmed_paths};
#[derive(Debug)]
pub enum GeneratorInteriorOrUpvar {
@ -2412,6 +2412,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
ObligationCauseCode::BindingObligation(item_def_id, span)
| ObligationCauseCode::ExprBindingObligation(item_def_id, span, ..) => {
let item_name = tcx.def_path_str(item_def_id);
let short_item_name = with_forced_trimmed_paths!(tcx.def_path_str(item_def_id));
let mut multispan = MultiSpan::from(span);
let sm = tcx.sess.source_map();
if let Some(ident) = tcx.opt_item_ident(item_def_id) {
@ -2424,9 +2425,9 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
multispan.push_span_label(ident.span, "required by a bound in this");
}
}
let descr = format!("required by a bound in `{}`", item_name);
let descr = format!("required by a bound in `{item_name}`");
if span.is_visible(sm) {
let msg = format!("required by this bound in `{}`", item_name);
let msg = format!("required by this bound in `{short_item_name}`");
multispan.push_span_label(span, msg);
err.span_note(multispan, &descr);
} else {

View File

@ -19,7 +19,7 @@ note: required by a bound in `a::bar`
--> $DIR/closure-return-type-must-be-sized.rs:14:19
|
LL | pub fn bar<F: FnOnce() -> R, R: ?Sized>() {}
| ^^^^^^^^^^^^^ required by this bound in `a::bar`
| ^^^^^^^^^^^^^ required by this bound in `bar`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
--> $DIR/closure-return-type-must-be-sized.rs:56:5
@ -51,7 +51,7 @@ note: required by a bound in `b::bar`
--> $DIR/closure-return-type-must-be-sized.rs:28:19
|
LL | pub fn bar<F: Fn() -> R, R: ?Sized>() {}
| ^^^^^^^^^ required by this bound in `b::bar`
| ^^^^^^^^^ required by this bound in `bar`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
--> $DIR/closure-return-type-must-be-sized.rs:63:5
@ -83,7 +83,7 @@ note: required by a bound in `c::bar`
--> $DIR/closure-return-type-must-be-sized.rs:42:19
|
LL | pub fn bar<F: FnMut() -> R, R: ?Sized>() {}
| ^^^^^^^^^^^^ required by this bound in `c::bar`
| ^^^^^^^^^^^^ required by this bound in `bar`
error[E0277]: the size for values of type `dyn A` cannot be known at compilation time
--> $DIR/closure-return-type-must-be-sized.rs:70:5

View File

@ -14,7 +14,7 @@ note: required by a bound in `use_trait_impl::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:17:5
@ -28,7 +28,7 @@ note: required by a bound in `use_trait_impl::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error: unconstrained generic constant
--> $DIR/abstract-const-as-cast-3.rs:20:19
@ -46,7 +46,7 @@ note: required by a bound in `use_trait_impl::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:20:5
@ -60,7 +60,7 @@ note: required by a bound in `use_trait_impl::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:23:5
@ -74,7 +74,7 @@ note: required by a bound in `use_trait_impl::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:25:5
@ -88,7 +88,7 @@ note: required by a bound in `use_trait_impl::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:14:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error: unconstrained generic constant
--> $DIR/abstract-const-as-cast-3.rs:35:19
@ -106,7 +106,7 @@ note: required by a bound in `use_trait_impl_2::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:35:5
@ -120,7 +120,7 @@ note: required by a bound in `use_trait_impl_2::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error: unconstrained generic constant
--> $DIR/abstract-const-as-cast-3.rs:38:19
@ -138,7 +138,7 @@ note: required by a bound in `use_trait_impl_2::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:38:5
@ -152,7 +152,7 @@ note: required by a bound in `use_trait_impl_2::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:41:5
@ -166,7 +166,7 @@ note: required by a bound in `use_trait_impl_2::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error[E0308]: mismatched types
--> $DIR/abstract-const-as-cast-3.rs:43:5
@ -180,7 +180,7 @@ note: required by a bound in `use_trait_impl_2::assert_impl`
--> $DIR/abstract-const-as-cast-3.rs:32:23
|
LL | fn assert_impl<T: Trait>() {}
| ^^^^^ required by this bound in `use_trait_impl_2::assert_impl`
| ^^^^^ required by this bound in `assert_impl`
error: aborting due to 12 previous errors

View File

@ -1,9 +1,20 @@
// compile-flags: --diagnostic-width=60
// normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
struct Atype<T, K>(T, K);
struct Btype<T, K>(T, K);
struct Ctype<T, K>(T, K);
mod a {
// Force the "short path for unique types" machinery to trip up
pub struct Atype;
pub struct Btype;
pub struct Ctype;
}
mod b {
pub struct Atype<T, K>(T, K);
pub struct Btype<T, K>(T, K);
pub struct Ctype<T, K>(T, K);
}
use b::*;
fn main() {
let x: Atype<

View File

@ -1,5 +1,5 @@
error[E0308]: mismatched types
--> $DIR/long-E0308.rs:33:9
--> $DIR/long-E0308.rs:44:9
|
LL | let x: Atype<
| _____________-
@ -24,7 +24,7 @@ LL | | ))))))))))))))))))))))))))))));
the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
error[E0308]: mismatched types
--> $DIR/long-E0308.rs:46:26
--> $DIR/long-E0308.rs:57:26
|
LL | ))))))))))))))))) == Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
| __________________________^
@ -40,7 +40,7 @@ LL | | ))))))))))))))))))))))));
the full type name has been written to '$TEST_BUILD_DIR/diagnostic-width/long-E0308/long-E0308.long-type-hash.txt'
error[E0308]: mismatched types
--> $DIR/long-E0308.rs:77:9
--> $DIR/long-E0308.rs:88:9
|
LL | let x: Atype<
| ____________-
@ -59,7 +59,7 @@ LL | | > = ();
found unit type `()`
error[E0308]: mismatched types
--> $DIR/long-E0308.rs:80:17
--> $DIR/long-E0308.rs:91:17
|
LL | let _: () = Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(Ok(O...
| ____________--___^

View File

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/disambiguate-identical-names.rs:13:10
|
LL | test(&v);
| ---- ^^ expected struct `std::vec::Vec`, found struct `HashMap`
| ---- ^^ expected struct `Vec`, found struct `HashMap`
| |
| arguments to this function are incorrect
|

View File

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/no-implicit-dyn-star.rs:6:48
|
LL | dyn_star_foreign::require_dyn_star_display(1usize);
| ------------------------------------------ ^^^^^^ expected trait object `dyn std::fmt::Display`, found `usize`
| ------------------------------------------ ^^^^^^ expected trait object `dyn Display`, found `usize`
| |
| arguments to this function are incorrect
|

View File

@ -8,7 +8,7 @@ note: required by a bound in `foo_defn::Foo::Bar`
--> $DIR/auxiliary/foo_defn.rs:4:15
|
LL | type Bar: AsRef<()>;
| ^^^^^^^^^ required by this bound in `foo_defn::Foo::Bar`
| ^^^^^^^^^ required by this bound in `Foo::Bar`
error: aborting due to previous error

View File

@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [_, 99.., _] => {},
| ^^ expected struct `std::ops::Range`, found integer
| ^^ expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`

View File

@ -10,7 +10,7 @@ error[E0308]: mismatched types
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [_, 99..] => {},
| ^^ expected struct `std::ops::Range`, found integer
| ^^ expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`

View File

@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [..9, 99..100, _] => {},
| ^ expected struct `std::ops::Range`, found integer
| ^ expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`
@ -17,7 +17,7 @@ LL | match [5..4, 99..105, 43..44] {
LL | [..9, 99..100, _] => {},
| ^^ --- this is of type `{integer}`
| |
| expected struct `std::ops::Range`, found integer
| expected struct `Range`, found integer
|
= note: expected struct `std::ops::Range<{integer}>`
found type `{integer}`
@ -28,7 +28,7 @@ error[E0308]: mismatched types
LL | match [5..4, 99..105, 43..44] {
| ----------------------- this expression has type `[std::ops::Range<{integer}>; 3]`
LL | [..9, 99..100, _] => {},
| -- ^^^ expected struct `std::ops::Range`, found integer
| -- ^^^ expected struct `Range`, found integer
| |
| this is of type `{integer}`
|

View File

@ -15,7 +15,7 @@ LL | type Foo = impl PartialEq<(Foo, i32)>;
LL | fn eq(&self, _other: &(Foo, i32)) -> bool {
| ^^^^^^^^^^^
| |
| expected struct `a::Bar`, found opaque type
| expected struct `Bar`, found opaque type
| help: change the parameter type to match the trait: `&(a::Bar, i32)`
|
= note: expected fn pointer `fn(&a::Bar, &(a::Bar, i32)) -> _`
@ -38,7 +38,7 @@ LL | type Foo = impl PartialEq<(Foo, i32)>;
LL | fn eq(&self, _other: &(Bar, i32)) -> bool {
| ^^^^^^^^^^^
| |
| expected opaque type, found struct `b::Bar`
| expected opaque type, found struct `Bar`
| help: change the parameter type to match the trait: `&(b::Foo, i32)`
|
= note: expected fn pointer `fn(&b::Bar, &(b::Foo, i32)) -> _`

View File

@ -11,7 +11,7 @@ note: required by a bound in `fold`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(B, Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `fold`
| ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::fold`
error: aborting due to previous error

View File

@ -18,7 +18,7 @@ note: required by a bound in `cloned`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | Self: Sized + Iterator<Item = &'a T>,
| ^^^^^^^^^^^^ required by this bound in `cloned`
| ^^^^^^^^^^^^ required by this bound in `Iterator::cloned`
error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, [closure@$DIR/issue-31173.rs:8:21: 8:25]>>`, but its trait bounds were not satisfied
--> $DIR/issue-31173.rs:13:10

View File

@ -12,7 +12,7 @@ note: required by a bound in `cloned`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | Self: Sized + Iterator<Item = &'a T>,
| ^^^^^^^^^^^^ required by this bound in `cloned`
| ^^^^^^^^^^^^ required by this bound in `Iterator::cloned`
error[E0271]: expected `std::collections::hash_map::Iter<'_, _, _>` to be an iterator that yields `&_`, but it yields `(&_, &_)`
--> $DIR/issue-33941.rs:6:14

View File

@ -26,7 +26,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 2 previous errors

View File

@ -12,7 +12,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error[E0277]: a value of type `Vec<f64>` cannot be built from an iterator over elements of type `&f64`
--> $DIR/issue-66923-show-error-for-correct-call.rs:12:14
@ -28,7 +28,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 2 previous errors

View File

@ -11,7 +11,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to previous error

View File

@ -19,7 +19,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^ required by this bound in `collect`
| ^ required by this bound in `Iterator::collect`
error[E0277]: a slice of type `[i32]` cannot be built since `[i32]` has no definite size
--> $DIR/collect-into-slice.rs:6:30
@ -34,7 +34,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 3 previous errors

View File

@ -11,7 +11,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to previous error

View File

@ -11,7 +11,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error[E0277]: a value of type `impl Debug` cannot be built from an iterator over elements of type `_`
--> $DIR/recursion4.rs:19:9
@ -26,7 +26,7 @@ note: required by a bound in `collect`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | fn collect<B: FromIterator<Self::Item>>(self) -> B
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `collect`
| ^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::collect`
error: aborting due to 2 previous errors

View File

@ -12,7 +12,7 @@ error[E0308]: mismatched types
LL | let Bar(z) = x;
| ^^^^^^ - this expression has type `&mut irrefutable::Foo`
| |
| expected struct `irrefutable::Foo`, found struct `irrefutable::Bar`
| expected struct `Foo`, found struct `Bar`
error: aborting due to 2 previous errors

View File

@ -57,7 +57,7 @@ error[E0308]: mismatched types
--> $DIR/issue-90315.rs:28:8
|
LL | if 1..(end + 1).is_empty() {
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
@ -77,7 +77,7 @@ error[E0308]: mismatched types
--> $DIR/issue-90315.rs:34:8
|
LL | if 1..(end + 1).is_sorted() {
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`
@ -97,7 +97,7 @@ error[E0308]: mismatched types
--> $DIR/issue-90315.rs:40:21
|
LL | let _res: i32 = 3..6.take(2).sum();
| --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `std::ops::Range`
| --- ^^^^^^^^^^^^^^^^^^ expected `i32`, found struct `Range`
| |
| expected due to this
|
@ -119,7 +119,7 @@ error[E0308]: mismatched types
--> $DIR/issue-90315.rs:45:21
|
LL | let _sum: i32 = 3..6.sum();
| --- ^^^^^^^^^^ expected `i32`, found struct `std::ops::Range`
| --- ^^^^^^^^^^ expected `i32`, found struct `Range`
| |
| expected due to this
|
@ -158,7 +158,7 @@ error[E0308]: mismatched types
--> $DIR/issue-90315.rs:62:8
|
LL | if 1..end.error_method() {
| ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<{integer}>`

View File

@ -130,7 +130,7 @@ note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: closure is expected to take a single 2-tuple as argument, but it takes 3 distinct arguments
--> $DIR/closure-arg-count.rs:27:57
@ -146,7 +146,7 @@ note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: function is expected to take a single 2-tuple as argument, but it takes 2 distinct arguments
--> $DIR/closure-arg-count.rs:29:57
@ -163,7 +163,7 @@ note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
--> $DIR/closure-arg-count.rs:32:45
@ -177,7 +177,7 @@ note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
--> $DIR/closure-arg-count.rs:35:10

View File

@ -12,7 +12,7 @@ note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:4:14
@ -28,7 +28,7 @@ note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error[E0631]: type mismatch in closure arguments
--> $DIR/closure-arg-type-mismatch.rs:5:14
@ -44,7 +44,7 @@ note: required by a bound in `map`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | F: FnMut(Self::Item) -> B,
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `map`
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::map`
error: aborting due to 3 previous errors

View File

@ -12,7 +12,7 @@ note: required by a bound in `filter`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | P: FnMut(&Self::Item) -> bool,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `filter`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::filter`
error[E0599]: the method `count` exists for struct `Filter<Fuse<std::iter::Once<&str>>, [closure@$DIR/issue-36053-2.rs:7:39: 7:48]>`, but its trait bounds were not satisfied
--> $DIR/issue-36053-2.rs:7:55

View File

@ -42,7 +42,7 @@ error[E0308]: mismatched types
--> $DIR/wrap-suggestion-privacy.rs:22:17
|
LL | needs_ready(Some(0));
| ----------- ^^^^^^^ expected struct `std::future::Ready`, found enum `Option`
| ----------- ^^^^^^^ expected struct `Ready`, found enum `Option`
| |
| arguments to this function are incorrect
|

View File

@ -14,7 +14,7 @@ note: required by a bound in `std::iter::Iterator::sum`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | S: Sum<Self::Item>,
| ^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::sum`
| ^^^^^^^^^^^^^^^ required by this bound in `Iterator::sum`
error[E0277]: a value of type `i32` cannot be made by multiplying all elements of type `&()` from an iterator
--> $DIR/sum.rs:7:5
@ -32,7 +32,7 @@ note: required by a bound in `std::iter::Iterator::product`
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
LL | P: Product<Self::Item>,
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `std::iter::Iterator::product`
| ^^^^^^^^^^^^^^^^^^^ required by this bound in `Iterator::product`
error: aborting due to 2 previous errors

View File

@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | take_range(std::ops::Range { start: 0, end: 1 });
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | expected reference, found struct `std::ops::Range`
| | expected reference, found struct `Range`
| | help: consider borrowing here: `&std::ops::Range { start: 0, end: 1 }`
| arguments to this function are incorrect
|
@ -22,7 +22,7 @@ error[E0308]: mismatched types
LL | take_range(::std::ops::Range { start: 0, end: 1 });
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | expected reference, found struct `std::ops::Range`
| | expected reference, found struct `Range`
| | help: consider borrowing here: `&::std::ops::Range { start: 0, end: 1 }`
| arguments to this function are incorrect
|

View File

@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | take_range(0..1);
| ---------- ^^^^
| | |
| | expected reference, found struct `std::ops::Range`
| | expected reference, found struct `Range`
| | help: consider borrowing here: `&(0..1)`
| arguments to this function are incorrect
|

View File

@ -4,7 +4,7 @@ error[E0308]: mismatched types
LL | demo(tell(1)..tell(10));
| ---- ^^^^^^^^^^^^^^^^^
| | |
| | expected reference, found struct `std::ops::Range`
| | expected `&Range<usize>`, found struct `Range`
| | help: consider borrowing here: `&(tell(1)..tell(10))`
| arguments to this function are incorrect
|
@ -22,7 +22,7 @@ error[E0308]: mismatched types
LL | demo(1..10);
| ---- ^^^^^
| | |
| | expected reference, found struct `std::ops::Range`
| | expected `&Range<usize>`, found struct `Range`
| | help: consider borrowing here: `&(1..10)`
| arguments to this function are incorrect
|

View File

@ -1516,7 +1516,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:157:8
|
LL | if true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1545,7 +1545,7 @@ error[E0308]: mismatched types
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found struct `std::ops::Range`
| expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
@ -1554,7 +1554,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:171:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1565,7 +1565,7 @@ error[E0308]: mismatched types
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found struct `std::ops::Range`
| expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
@ -1574,7 +1574,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:175:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1585,7 +1585,7 @@ error[E0308]: mismatched types
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
| |
| expected fn pointer, found struct `std::ops::Range`
| expected fn pointer, found struct `Range`
|
= note: expected fn pointer `fn() -> bool`
found struct `std::ops::Range<_>`
@ -1607,7 +1607,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:182:8
|
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1618,7 +1618,7 @@ error[E0308]: mismatched types
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
| |
| expected `bool`, found struct `std::ops::Range`
| expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
@ -1639,7 +1639,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:190:8
|
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1710,7 +1710,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:249:11
|
LL | while true..(let 0 = 0) {}
| ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1739,7 +1739,7 @@ error[E0308]: mismatched types
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found struct `std::ops::Range`
| expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
@ -1748,7 +1748,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:263:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1759,7 +1759,7 @@ error[E0308]: mismatched types
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found struct `std::ops::Range`
| expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
@ -1768,7 +1768,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:267:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1779,7 +1779,7 @@ error[E0308]: mismatched types
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `fn() -> bool`
| |
| expected fn pointer, found struct `std::ops::Range`
| expected fn pointer, found struct `Range`
|
= note: expected fn pointer `fn() -> bool`
found struct `std::ops::Range<_>`
@ -1801,7 +1801,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:274:11
|
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1812,7 +1812,7 @@ error[E0308]: mismatched types
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this expression has type `&&bool`
| |
| expected `bool`, found struct `std::ops::Range`
| expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`
@ -1833,7 +1833,7 @@ error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:282:11
|
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<bool>`
@ -1883,7 +1883,7 @@ error[E0308]: mismatched types
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this expression has type `bool`
| |
| expected `bool`, found struct `std::ops::Range`
| expected `bool`, found struct `Range`
|
= note: expected type `bool`
found struct `std::ops::Range<_>`

View File

@ -18,7 +18,7 @@ error[E0308]: mismatched types
--> $DIR/struct-record-suggestion.rs:23:20
|
LL | let q = B { b: 1..Default::default() };
| ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `std::ops::Range`
| ^^^^^^^^^^^^^^^^^^^^^ expected `u32`, found struct `Range`
|
= note: expected type `u32`
found struct `std::ops::Range<{integer}>`

View File

@ -80,7 +80,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Foo<T>: Sized {
@ -96,7 +96,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Bar: std::fmt::Display + Sized {
@ -112,7 +112,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Baz: Sized where Self: std::fmt::Display {
@ -128,7 +128,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Qux<T>: Sized where Self: std::fmt::Display {
@ -144,7 +144,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
help: consider further restricting `Self`
|
LL | trait Bat<T>: std::fmt::Display + Sized {

View File

@ -2,7 +2,7 @@ error[E0308]: mismatched types
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:2:18
|
LL | let _: f64 = 0..10;
| --- ^^^^^ expected `f64`, found struct `std::ops::Range`
| --- ^^^^^ expected `f64`, found struct `Range`
| |
| expected due to this
|
@ -47,7 +47,7 @@ error[E0308]: mismatched types
--> $DIR/unnecessary_dot_for_floating_point_literal.rs:5:18
|
LL | let _: f64 = std::ops::Range { start: 0, end: 1 };
| --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `std::ops::Range`
| --- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `f64`, found struct `Range`
| |
| expected due to this
|

View File

@ -11,7 +11,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn check<T: Iterator, U: ?Sized>() {
@ -36,7 +36,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
help: consider removing the `?Sized` bound to make the type parameter `Sized`
|
LL - fn check<T: Iterator, U: ?Sized>() {
@ -82,7 +82,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
error[E0277]: the size for values of type `[&U]` cannot be known at compilation time
--> $DIR/suggest-where-clause.rs:31:20
@ -95,7 +95,7 @@ note: required by a bound in `std::mem::size_of`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
|
LL | pub const fn size_of<T>() -> usize {
| ^ required by this bound in `std::mem::size_of`
| ^ required by this bound in `size_of`
error: aborting due to 7 previous errors

View File

@ -55,7 +55,7 @@ error[E0308]: mismatched types
--> $DIR/type-ascription-precedence.rs:53:5
|
LL | (S .. S): S;
| ^^^^^^^^ expected struct `S`, found struct `std::ops::Range`
| ^^^^^^^^ expected struct `S`, found struct `Range`
|
= note: expected struct `S`
found struct `std::ops::Range<S>`

View File

@ -5,7 +5,7 @@ LL | fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I
| - this type parameter - expected `I` because of return type
...
LL | self.iter()
| ^^^^^^^^^^^ expected type parameter `I`, found struct `std::slice::Iter`
| ^^^^^^^^^^^ expected type parameter `I`, found struct `Iter`
|
= note: expected type parameter `I`
found struct `std::slice::Iter<'_, N>`