Auto merge of #141545 - GuillaumeGomez:rollup-myrvuqq, r=GuillaumeGomez
Rollup of 6 pull requests Successful merges: - rust-lang/rust#141413 (Make #[cfg(version)] respect RUSTC_OVERRIDE_VERSION_STRING) - rust-lang/rust#141443 (make teach_help message for cast-before-pass-to-variadic more precise) - rust-lang/rust#141508 (bootstrap: clippy: set TESTNAME based on given paths) - rust-lang/rust#141512 (Avoid extra path trimming in method not found error) - rust-lang/rust#141530 (Added unstable feature doc comments to unstable book) - rust-lang/rust#141541 (Random nits) r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
283db70ace
38 changed files with 197 additions and 62 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use std::fmt::{self, Display};
|
||||
use std::sync::OnceLock;
|
||||
|
||||
use rustc_macros::{
|
||||
Decodable, Encodable, HashStable_Generic, PrintAttribute, current_rustc_version,
|
||||
|
|
@ -16,8 +17,29 @@ pub struct RustcVersion {
|
|||
|
||||
impl RustcVersion {
|
||||
pub const CURRENT: Self = current_rustc_version!();
|
||||
pub fn current_overridable() -> Self {
|
||||
*CURRENT_OVERRIDABLE.get_or_init(|| {
|
||||
if let Ok(override_var) = std::env::var("RUSTC_OVERRIDE_VERSION_STRING")
|
||||
&& let Some(override_) = Self::parse_str(&override_var)
|
||||
{
|
||||
override_
|
||||
} else {
|
||||
Self::CURRENT
|
||||
}
|
||||
})
|
||||
}
|
||||
fn parse_str(value: &str) -> Option<Self> {
|
||||
// Ignore any suffixes such as "-dev" or "-nightly".
|
||||
let mut components = value.split('-').next().unwrap().splitn(3, '.');
|
||||
let major = components.next()?.parse().ok()?;
|
||||
let minor = components.next()?.parse().ok()?;
|
||||
let patch = components.next().unwrap_or("0").parse().ok()?;
|
||||
Some(RustcVersion { major, minor, patch })
|
||||
}
|
||||
}
|
||||
|
||||
static CURRENT_OVERRIDABLE: OnceLock<RustcVersion> = OnceLock::new();
|
||||
|
||||
impl Display for RustcVersion {
|
||||
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
write!(formatter, "{}.{}.{}", self.major, self.minor, self.patch)
|
||||
|
|
|
|||
|
|
@ -129,9 +129,9 @@ pub fn eval_condition(
|
|||
|
||||
// See https://github.com/rust-lang/rust/issues/64796#issuecomment-640851454 for details
|
||||
if sess.psess.assume_incomplete_release {
|
||||
RustcVersion::CURRENT > min_version
|
||||
RustcVersion::current_overridable() > min_version
|
||||
} else {
|
||||
RustcVersion::CURRENT >= min_version
|
||||
RustcVersion::current_overridable() >= min_version
|
||||
}
|
||||
}
|
||||
MetaItemKind::List(mis) => {
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ hir_typeck_option_result_copied = use `{$def_path}::copied` to copy the value in
|
|||
|
||||
hir_typeck_pass_to_variadic_function = can't pass `{$ty}` to variadic function
|
||||
.suggestion = cast the value to `{$cast_ty}`
|
||||
.teach_help = certain types, like `{$ty}`, must be casted before passing them to a variadic function, because of arcane ABI rules dictated by the C standard
|
||||
.teach_help = certain types, like `{$ty}`, must be cast before passing them to a variadic function to match the implicit cast that a C compiler would perform as part of C's numeric promotion rules
|
||||
|
||||
hir_typeck_ptr_cast_add_auto_to_object = cannot add {$traits_len ->
|
||||
[1] auto trait {$traits}
|
||||
|
|
|
|||
|
|
@ -599,7 +599,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
let tcx = self.tcx;
|
||||
let rcvr_ty = self.resolve_vars_if_possible(rcvr_ty);
|
||||
let mut ty_file = None;
|
||||
let (mut ty_str, short_ty_str) =
|
||||
let (ty_str, short_ty_str) =
|
||||
if trait_missing_method && let ty::Dynamic(predicates, _, _) = rcvr_ty.kind() {
|
||||
(predicates.to_string(), with_forced_trimmed_paths!(predicates.to_string()))
|
||||
} else {
|
||||
|
|
@ -738,10 +738,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
|
|||
err.span_label(within_macro_span, "due to this macro variable");
|
||||
}
|
||||
|
||||
if short_ty_str.len() < ty_str.len() && ty_str.len() > 10 {
|
||||
ty_str = short_ty_str;
|
||||
}
|
||||
|
||||
if rcvr_ty.references_error() {
|
||||
err.downgrade_to_delayed_bug();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ use crate::infer::canonical::{
|
|||
QueryOutlivesConstraint, QueryRegionConstraints, QueryResponse,
|
||||
};
|
||||
use crate::infer::region_constraints::{Constraint, RegionConstraintData};
|
||||
use crate::infer::{DefineOpaqueTypes, InferCtxt, InferOk, InferResult};
|
||||
use crate::infer::{DefineOpaqueTypes, InferCtxt, InferOk, InferResult, SubregionOrigin};
|
||||
use crate::traits::query::NoSolution;
|
||||
use crate::traits::{
|
||||
Obligation, ObligationCause, PredicateObligation, PredicateObligations, ScrubbedTraitError,
|
||||
|
|
@ -593,10 +593,10 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||
// no action needed
|
||||
}
|
||||
(GenericArgKind::Lifetime(v1), GenericArgKind::Lifetime(v2)) => {
|
||||
obligations.extend(
|
||||
self.at(cause, param_env)
|
||||
.eq(DefineOpaqueTypes::Yes, v1, v2)?
|
||||
.into_obligations(),
|
||||
self.inner.borrow_mut().unwrap_region_constraints().make_eqregion(
|
||||
SubregionOrigin::RelateRegionParamBound(cause.span, None),
|
||||
v1,
|
||||
v2,
|
||||
);
|
||||
}
|
||||
(GenericArgKind::Const(v1), GenericArgKind::Const(v2)) => {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ use crate::solve::inspect::{self, ProofTreeInferCtxtExt};
|
|||
|
||||
#[extension(pub trait InferCtxtSelectExt<'tcx>)]
|
||||
impl<'tcx> InferCtxt<'tcx> {
|
||||
/// Do not use this directly. This is called from [`crate::traits::SelectionContext::select`].
|
||||
fn select_in_new_trait_solver(
|
||||
&self,
|
||||
obligation: &TraitObligation<'tcx>,
|
||||
|
|
|
|||
|
|
@ -739,7 +739,7 @@ impl Step for Clippy {
|
|||
const DEFAULT: bool = false;
|
||||
|
||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||
run.path("src/tools/clippy")
|
||||
run.suite_path("src/tools/clippy/tests").path("src/tools/clippy")
|
||||
}
|
||||
|
||||
fn make_run(run: RunConfig<'_>) {
|
||||
|
|
@ -783,6 +783,23 @@ impl Step for Clippy {
|
|||
let host_libs = builder.stage_out(compiler, Mode::ToolRustc).join(builder.cargo_dir());
|
||||
cargo.env("HOST_LIBS", host_libs);
|
||||
|
||||
// Collect paths of tests to run
|
||||
'partially_test: {
|
||||
let paths = &builder.config.paths[..];
|
||||
let mut test_names = Vec::new();
|
||||
for path in paths {
|
||||
if let Some(path) =
|
||||
helpers::is_valid_test_suite_arg(path, "src/tools/clippy/tests", builder)
|
||||
{
|
||||
test_names.push(path);
|
||||
} else if path.ends_with("src/tools/clippy") {
|
||||
// When src/tools/clippy is called directly, all tests should be run.
|
||||
break 'partially_test;
|
||||
}
|
||||
}
|
||||
cargo.env("TESTNAME", test_names.join(","));
|
||||
}
|
||||
|
||||
cargo.add_rustc_lib_path(builder);
|
||||
let cargo = prepare_cargo_test(cargo, &[], &[], host, builder);
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ pub struct Feature {
|
|||
pub tracking_issue: Option<NonZeroU32>,
|
||||
pub file: PathBuf,
|
||||
pub line: usize,
|
||||
pub description: Option<String>,
|
||||
}
|
||||
impl Feature {
|
||||
fn tracking_issue_display(&self) -> impl fmt::Display {
|
||||
|
|
@ -296,6 +297,7 @@ fn collect_lang_features_in(features: &mut Features, base: &Path, file: &str, ba
|
|||
let mut prev_names = vec![];
|
||||
|
||||
let lines = contents.lines().zip(1..);
|
||||
let mut doc_comments: Vec<String> = Vec::new();
|
||||
for (line, line_number) in lines {
|
||||
let line = line.trim();
|
||||
|
||||
|
|
@ -332,6 +334,13 @@ fn collect_lang_features_in(features: &mut Features, base: &Path, file: &str, ba
|
|||
continue;
|
||||
}
|
||||
|
||||
if in_feature_group {
|
||||
if let Some(doc_comment) = line.strip_prefix("///") {
|
||||
doc_comments.push(doc_comment.trim().to_string());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
let mut parts = line.split(',');
|
||||
let level = match parts.next().map(|l| l.trim().trim_start_matches('(')) {
|
||||
Some("unstable") => Status::Unstable,
|
||||
|
|
@ -438,9 +447,15 @@ fn collect_lang_features_in(features: &mut Features, base: &Path, file: &str, ba
|
|||
tracking_issue,
|
||||
file: path.to_path_buf(),
|
||||
line: line_number,
|
||||
description: if doc_comments.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(doc_comments.join(" "))
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
doc_comments.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -564,6 +579,7 @@ fn map_lib_features(
|
|||
tracking_issue: find_attr_val(line, "issue").and_then(handle_issue_none),
|
||||
file: file.to_path_buf(),
|
||||
line: i + 1,
|
||||
description: None,
|
||||
};
|
||||
mf(Ok((feature_name, feature)), file, i + 1);
|
||||
continue;
|
||||
|
|
@ -600,6 +616,7 @@ fn map_lib_features(
|
|||
tracking_issue,
|
||||
file: file.to_path_buf(),
|
||||
line: i + 1,
|
||||
description: None,
|
||||
};
|
||||
if line.contains(']') {
|
||||
mf(Ok((feature_name, feature)), file, i + 1);
|
||||
|
|
|
|||
|
|
@ -12,13 +12,18 @@ use tidy::unstable_book::{
|
|||
collect_unstable_feature_names,
|
||||
};
|
||||
|
||||
fn generate_stub_issue(path: &Path, name: &str, issue: u32) {
|
||||
let content = format!(include_str!("stub-issue.md"), name = name, issue = issue);
|
||||
fn generate_stub_issue(path: &Path, name: &str, issue: u32, description: &str) {
|
||||
let content = format!(
|
||||
include_str!("stub-issue.md"),
|
||||
name = name,
|
||||
issue = issue,
|
||||
description = description
|
||||
);
|
||||
t!(write(path, content), path);
|
||||
}
|
||||
|
||||
fn generate_stub_no_issue(path: &Path, name: &str) {
|
||||
let content = format!(include_str!("stub-no-issue.md"), name = name);
|
||||
fn generate_stub_no_issue(path: &Path, name: &str, description: &str) {
|
||||
let content = format!(include_str!("stub-no-issue.md"), name = name, description = description);
|
||||
t!(write(path, content), path);
|
||||
}
|
||||
|
||||
|
|
@ -58,11 +63,17 @@ fn generate_unstable_book_files(src: &Path, out: &Path, features: &Features) {
|
|||
let file_name = format!("{feature_name}.md");
|
||||
let out_file_path = out.join(&file_name);
|
||||
let feature = &features[&feature_name_underscore];
|
||||
let description = feature.description.as_deref().unwrap_or_default();
|
||||
|
||||
if let Some(issue) = feature.tracking_issue {
|
||||
generate_stub_issue(&out_file_path, &feature_name_underscore, issue.get());
|
||||
generate_stub_issue(
|
||||
&out_file_path,
|
||||
&feature_name_underscore,
|
||||
issue.get(),
|
||||
&description,
|
||||
);
|
||||
} else {
|
||||
generate_stub_no_issue(&out_file_path, &feature_name_underscore);
|
||||
generate_stub_no_issue(&out_file_path, &feature_name_underscore, &description);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
# `{name}`
|
||||
|
||||
{description}
|
||||
|
||||
The tracking issue for this feature is: [#{issue}]
|
||||
|
||||
[#{issue}]: https://github.com/rust-lang/rust/issues/{issue}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
# `{name}`
|
||||
|
||||
{description}
|
||||
|
||||
This feature has no tracking issue, and is therefore likely internal to the compiler, not being intended for general use.
|
||||
|
||||
------------------------
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ error[E0599]: no method named `foo` found for struct `dep_2_reexport::Type` in t
|
|||
--> replaced
|
||||
|
|
||||
LL | Type.foo();
|
||||
| ^^^ method not found in `Type`
|
||||
| ^^^ method not found in `dep_2_reexport::Type`
|
||||
|
|
||||
note: there are multiple different versions of crate `dependency` in the dependency graph
|
||||
--> replaced
|
||||
|
|
@ -63,7 +63,7 @@ error[E0599]: no function or associated item named `bar` found for struct `dep_2
|
|||
--> replaced
|
||||
|
|
||||
LL | Type::bar();
|
||||
| ^^^ function or associated item not found in `Type`
|
||||
| ^^^ function or associated item not found in `dep_2_reexport::Type`
|
||||
|
|
||||
note: there are multiple different versions of crate `dependency` in the dependency graph
|
||||
--> replaced
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ error[E0599]: no function or associated item named `default` found for trait obj
|
|||
--> $DIR/issue-43924.rs:14:39
|
||||
|
|
||||
LL | assert_eq!(<() as Foo<u32>>::Out::default().to_string(), "false");
|
||||
| ^^^^^^^ function or associated item not found in `dyn ToString`
|
||||
| ^^^^^^^ function or associated item not found in `(dyn ToString + 'static)`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -42,13 +42,13 @@ error[E0599]: no method named `foo` found for struct `rustc_confusables_across_c
|
|||
--> $DIR/rustc_confusables.rs:15:7
|
||||
|
|
||||
LL | x.foo();
|
||||
| ^^^ method not found in `BTreeSet`
|
||||
| ^^^ method not found in `rustc_confusables_across_crate::BTreeSet`
|
||||
|
||||
error[E0599]: no method named `push` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope
|
||||
--> $DIR/rustc_confusables.rs:17:7
|
||||
|
|
||||
LL | x.push();
|
||||
| ^^^^ method not found in `BTreeSet`
|
||||
| ^^^^ method not found in `rustc_confusables_across_crate::BTreeSet`
|
||||
|
|
||||
help: you might have meant to use `insert`
|
||||
|
|
||||
|
|
@ -60,7 +60,7 @@ error[E0599]: no method named `test` found for struct `rustc_confusables_across_
|
|||
--> $DIR/rustc_confusables.rs:20:7
|
||||
|
|
||||
LL | x.test();
|
||||
| ^^^^ method not found in `BTreeSet`
|
||||
| ^^^^ method not found in `rustc_confusables_across_crate::BTreeSet`
|
||||
|
||||
error[E0599]: no method named `pulled` found for struct `rustc_confusables_across_crate::BTreeSet` in the current scope
|
||||
--> $DIR/rustc_confusables.rs:22:7
|
||||
|
|
|
|||
30
tests/ui/cfg/cfg-version/cfg-version-expand.rs
Normal file
30
tests/ui/cfg/cfg-version/cfg-version-expand.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//@ run-pass
|
||||
//@ rustc-env:RUSTC_OVERRIDE_VERSION_STRING=1.50.3
|
||||
|
||||
#![feature(cfg_version)]
|
||||
|
||||
#[cfg(version("1.49.0"))]
|
||||
const ON_1_49_0: bool = true;
|
||||
#[cfg(version("1.50"))]
|
||||
const ON_1_50_0: bool = true;
|
||||
#[cfg(not(version("1.51")))]
|
||||
const ON_1_51_0: bool = false;
|
||||
|
||||
// This one uses the wrong syntax, so doesn't eval to true
|
||||
#[warn(unexpected_cfgs)]
|
||||
#[cfg(not(version = "1.48.0"))] //~ WARN unexpected `cfg` condition name: `version`
|
||||
const ON_1_48_0: bool = false;
|
||||
|
||||
fn main() {
|
||||
assert!(!ON_1_48_0);
|
||||
assert!(ON_1_49_0);
|
||||
assert!(ON_1_50_0);
|
||||
assert!(!ON_1_51_0);
|
||||
assert!(cfg!(version("1.1")));
|
||||
assert!(cfg!(version("1.49")));
|
||||
assert!(cfg!(version("1.50.0")));
|
||||
assert!(cfg!(version("1.50.3")));
|
||||
assert!(!cfg!(version("1.50.4")));
|
||||
assert!(!cfg!(version("1.51")));
|
||||
assert!(!cfg!(version("1.100")));
|
||||
}
|
||||
17
tests/ui/cfg/cfg-version/cfg-version-expand.stderr
Normal file
17
tests/ui/cfg/cfg-version/cfg-version-expand.stderr
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
warning: unexpected `cfg` condition name: `version`
|
||||
--> $DIR/cfg-version-expand.rs:15:11
|
||||
|
|
||||
LL | #[cfg(not(version = "1.48.0"))]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: to expect this configuration use `--check-cfg=cfg(version, values("1.48.0"))`
|
||||
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg.html> for more information about checking conditional configuration
|
||||
= note: `#[warn(unexpected_cfgs)]` on by default
|
||||
help: there is a similar config predicate: `version("..")`
|
||||
|
|
||||
LL - #[cfg(not(version = "1.48.0"))]
|
||||
LL + #[cfg(not(version("1.48.0")))]
|
||||
|
|
||||
|
||||
warning: 1 warning emitted
|
||||
|
||||
|
|
@ -121,7 +121,7 @@ error[E0599]: no variant or associated item named `Empty3` found for enum `empty
|
|||
--> $DIR/empty-struct-braces-expr.rs:25:19
|
||||
|
|
||||
LL | let xe3 = XE::Empty3;
|
||||
| ^^^^^^ variant or associated item not found in `XE`
|
||||
| ^^^^^^ variant or associated item not found in `empty_struct::XE`
|
||||
|
|
||||
help: there is a variant with a similar name
|
||||
|
|
||||
|
|
@ -132,7 +132,7 @@ error[E0599]: no variant or associated item named `Empty3` found for enum `empty
|
|||
--> $DIR/empty-struct-braces-expr.rs:26:19
|
||||
|
|
||||
LL | let xe3 = XE::Empty3();
|
||||
| ^^^^^^ variant or associated item not found in `XE`
|
||||
| ^^^^^^ variant or associated item not found in `empty_struct::XE`
|
||||
|
|
||||
help: there is a variant with a similar name
|
||||
|
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
<svg width="1902px" height="4322px" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="2322px" height="4322px" xmlns="http://www.w3.org/2000/svg">
|
||||
<style>
|
||||
.fg { fill: #AAAAAA }
|
||||
.bg { background: #000000 }
|
||||
|
|
@ -99,7 +99,7 @@
|
|||
</tspan>
|
||||
<tspan x="10px" y="712px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="730px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<IntoIter<bool, Vec<HashSet<u8>>>, {closure@multiline-removal-suggestion.rs:14:8}>>`, but its trait bounds were not satisfied</tspan>
|
||||
<tspan x="10px" y="730px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<std::collections::hash_map::IntoIter<bool, Vec<HashSet<u8>>>, {closure@$DIR/multiline-removal-suggestion.rs:14:8: 14:23}>>`, but its trait bounds were not satisfied</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="748px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/multiline-removal-suggestion.rs:24:4</tspan>
|
||||
</tspan>
|
||||
|
|
@ -213,7 +213,7 @@
|
|||
</tspan>
|
||||
<tspan x="10px" y="1738px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="1756px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<IntoIter<bool, Vec<HashSet<u8>>>, {closure@multiline-removal-suggestion.rs:29:8}>>`, but its trait bounds were not satisfied</tspan>
|
||||
<tspan x="10px" y="1756px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<std::collections::hash_map::IntoIter<bool, Vec<HashSet<u8>>>, {closure@$DIR/multiline-removal-suggestion.rs:29:8: 29:23}>>`, but its trait bounds were not satisfied</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="1774px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/multiline-removal-suggestion.rs:35:4</tspan>
|
||||
</tspan>
|
||||
|
|
@ -329,7 +329,7 @@
|
|||
</tspan>
|
||||
<tspan x="10px" y="2782px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="2800px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<IntoIter<bool, Vec<HashSet<u8>>>, {closure@multiline-removal-suggestion.rs:40:8}>>`, but its trait bounds were not satisfied</tspan>
|
||||
<tspan x="10px" y="2800px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<std::collections::hash_map::IntoIter<bool, Vec<HashSet<u8>>>, {closure@$DIR/multiline-removal-suggestion.rs:40:8: 40:23}>>`, but its trait bounds were not satisfied</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="2818px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/multiline-removal-suggestion.rs:46:4</tspan>
|
||||
</tspan>
|
||||
|
|
@ -441,7 +441,7 @@
|
|||
</tspan>
|
||||
<tspan x="10px" y="3790px">
|
||||
</tspan>
|
||||
<tspan x="10px" y="3808px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<IntoIter<bool, Vec<HashSet<u8>>>, {closure@multiline-removal-suggestion.rs:51:8}>>`, but its trait bounds were not satisfied</tspan>
|
||||
<tspan x="10px" y="3808px"><tspan class="fg-ansi256-009 bold">error[E0599]</tspan><tspan class="bold">: the method `collect` exists for struct `Flatten<Map<std::collections::hash_map::IntoIter<bool, Vec<HashSet<u8>>>, {closure@$DIR/multiline-removal-suggestion.rs:51:8: 51:23}>>`, but its trait bounds were not satisfied</tspan>
|
||||
</tspan>
|
||||
<tspan x="10px" y="3826px"><tspan> </tspan><tspan class="fg-ansi256-012 bold">--> </tspan><tspan>$DIR/multiline-removal-suggestion.rs:56:4</tspan>
|
||||
</tspan>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
|
@ -8,7 +8,7 @@ error[E0599]: no method named `bar` found for struct `Arc<{closure@$DIR/fn-help-
|
|||
--> $DIR/fn-help-with-err.rs:19:10
|
||||
|
|
||||
LL | arc2.bar();
|
||||
| ^^^ method not found in `Arc<{closure@fn-help-with-err.rs:18:36}>`
|
||||
| ^^^ method not found in `Arc<{closure@$DIR/fn-help-with-err.rs:18:36: 18:38}>`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `Bar` defines an item `bar`, perhaps you need to implement it
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0599]: the method `filterx` exists for struct `Map<Repeat, {closure@hrtb-doesnt-borrow-self-1.rs:113:27}>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the method `filterx` exists for struct `Map<Repeat, {closure@$DIR/hrtb-doesnt-borrow-self-1.rs:113:27: 113:34}>`, but its trait bounds were not satisfied
|
||||
--> $DIR/hrtb-doesnt-borrow-self-1.rs:114:22
|
||||
|
|
||||
LL | pub struct Map<S, F> {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, fn(&u64) -> &u64 {identity::<u64>}>, {closure@hrtb-doesnt-borrow-self-2.rs:109:30}>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the method `countx` exists for struct `Filter<Map<Repeat, for<'a> fn(&'a u64) -> &'a u64 {identity::<u64>}>, {closure@$DIR/hrtb-doesnt-borrow-self-2.rs:109:30: 109:37}>`, but its trait bounds were not satisfied
|
||||
--> $DIR/hrtb-doesnt-borrow-self-2.rs:110:24
|
||||
|
|
||||
LL | pub struct Filter<S, F> {
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ error[E0599]: no method named `method2` found for struct `no_method_suggested_tr
|
|||
--> $DIR/no-method-suggested-traits.rs:52:37
|
||||
|
|
||||
LL | no_method_suggested_traits::Foo.method2();
|
||||
| ^^^^^^^ method not found in `Foo`
|
||||
| ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
|
||||
|
|
@ -186,7 +186,7 @@ error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method
|
|||
--> $DIR/no-method-suggested-traits.rs:54:71
|
||||
|
|
||||
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Foo>>`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
|
||||
|
|
@ -199,7 +199,7 @@ error[E0599]: no method named `method2` found for enum `no_method_suggested_trai
|
|||
--> $DIR/no-method-suggested-traits.rs:56:40
|
||||
|
|
||||
LL | no_method_suggested_traits::Bar::X.method2();
|
||||
| ^^^^^^^ method not found in `Bar`
|
||||
| ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
|
||||
|
|
@ -212,7 +212,7 @@ error[E0599]: no method named `method2` found for struct `Rc<&mut Box<&no_method
|
|||
--> $DIR/no-method-suggested-traits.rs:58:74
|
||||
|
|
||||
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&Bar>>`
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Bar>>`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `foo::Bar` defines an item `method2`, perhaps you need to implement it
|
||||
|
|
@ -283,25 +283,25 @@ error[E0599]: no method named `method3` found for struct `no_method_suggested_tr
|
|||
--> $DIR/no-method-suggested-traits.rs:73:37
|
||||
|
|
||||
LL | no_method_suggested_traits::Foo.method3();
|
||||
| ^^^^^^^ method not found in `Foo`
|
||||
| ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
|
||||
|
||||
error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Foo>>` in the current scope
|
||||
--> $DIR/no-method-suggested-traits.rs:74:71
|
||||
|
|
||||
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&Foo>>`
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Foo>>`
|
||||
|
||||
error[E0599]: no method named `method3` found for enum `no_method_suggested_traits::Bar` in the current scope
|
||||
--> $DIR/no-method-suggested-traits.rs:76:40
|
||||
|
|
||||
LL | no_method_suggested_traits::Bar::X.method3();
|
||||
| ^^^^^^^ method not found in `Bar`
|
||||
| ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
|
||||
|
||||
error[E0599]: no method named `method3` found for struct `Rc<&mut Box<&no_method_suggested_traits::Bar>>` in the current scope
|
||||
--> $DIR/no-method-suggested-traits.rs:77:74
|
||||
|
|
||||
LL | std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&Bar>>`
|
||||
| ^^^^^^^ method not found in `Rc<&mut Box<&no_method_suggested_traits::Bar>>`
|
||||
|
||||
error: aborting due to 24 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no function or associated item named `new_undirected` found for st
|
|||
--> $DIR/issue-30123.rs:7:33
|
||||
|
|
||||
LL | let ug = Graph::<i32, i32>::new_undirected();
|
||||
| ^^^^^^^^^^^^^^ function or associated item not found in `Graph<i32, i32>`
|
||||
| ^^^^^^^^^^^^^^ function or associated item not found in `issue_30123_aux::Graph<i32, i32>`
|
||||
|
|
||||
note: if you're trying to build a new `issue_30123_aux::Graph<i32, i32>`, consider using `issue_30123_aux::Graph::<N, E>::new` which returns `issue_30123_aux::Graph<_, _>`
|
||||
--> $DIR/auxiliary/issue-30123-aux.rs:14:5
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ LL | pub struct Iterate<T, F> {
|
|||
| ------------------------ method `iter` not found for this struct
|
||||
...
|
||||
LL | println!("{:?}", a.iter().take(10).collect::<Vec<usize>>());
|
||||
| ^^^^ method not found in `Iterate<{integer}, {closure@issue-41880.rs:26:24}>`
|
||||
| ^^^^ method not found in `Iterate<{integer}, {closure@$DIR/issue-41880.rs:26:24: 26:27}>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ error[E0599]: cannot write into `&'static str`
|
|||
--> $DIR/missing-writer.rs:5:12
|
||||
|
|
||||
LL | write!("{}_{}", x, y);
|
||||
| -------^^^^^^^------- method not found in `&str`
|
||||
| -------^^^^^^^------- method not found in `&'static str`
|
||||
|
|
||||
note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
|
||||
--> $DIR/missing-writer.rs:5:12
|
||||
|
|
@ -41,7 +41,7 @@ error[E0599]: cannot write into `&'static str`
|
|||
--> $DIR/missing-writer.rs:11:14
|
||||
|
|
||||
LL | writeln!("{}_{}", x, y);
|
||||
| ---------^^^^^^^------- method not found in `&str`
|
||||
| ---------^^^^^^^------- method not found in `&'static str`
|
||||
|
|
||||
note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
|
||||
--> $DIR/missing-writer.rs:11:14
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `homura` found for reference `&'static str` in the
|
|||
--> $DIR/issue-19521.rs:2:8
|
||||
|
|
||||
LL | "".homura()();
|
||||
| ^^^^^^ method not found in `&str`
|
||||
| ^^^^^^ method not found in `&'static str`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ error[E0599]: no method named `extend` found for struct `Map` in the current sco
|
|||
--> $DIR/method-not-found-generic-arg-elision.rs:87:67
|
||||
|
|
||||
LL | v.iter().map(Box::new(|x| x * x) as Box<dyn Fn(&i32) -> i32>).extend(std::iter::once(100));
|
||||
| ^^^^^^ method not found in `Map<Iter<'_, i32>, Box<dyn Fn(&i32) -> i32>>`
|
||||
| ^^^^^^ method not found in `Map<std::slice::Iter<'_, i32>, Box<dyn for<'a> Fn(&'a i32) -> i32>>`
|
||||
|
||||
error[E0599]: no method named `method` found for struct `Wrapper<bool>` in the current scope
|
||||
--> $DIR/method-not-found-generic-arg-elision.rs:90:13
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ LL | struct B<T>(T);
|
|||
| ----------- function or associated item `method` not found for this struct
|
||||
...
|
||||
LL | B::<for<'a> fn(&'a ())>::method(y);
|
||||
| ^^^^^^ function or associated item not found in `B<fn(&())>`
|
||||
| ^^^^^^ function or associated item not found in `B<for<'a> fn(&'a ())>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
|||
11
tests/ui/methods/untrimmed-path-type.rs
Normal file
11
tests/ui/methods/untrimmed-path-type.rs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
// Ensures that the path of the `Error` type is not trimmed
|
||||
// to make it clear which Error type is meant.
|
||||
|
||||
fn main() {
|
||||
meow().unknown(); //~ ERROR no method named `unknown` found
|
||||
//~^ NOTE method not found in `Result<(), std::io::Error>`
|
||||
}
|
||||
|
||||
fn meow() -> Result<(), std::io::Error> {
|
||||
Ok(())
|
||||
}
|
||||
9
tests/ui/methods/untrimmed-path-type.stderr
Normal file
9
tests/ui/methods/untrimmed-path-type.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0599]: no method named `unknown` found for enum `Result` in the current scope
|
||||
--> $DIR/untrimmed-path-type.rs:5:11
|
||||
|
|
||||
LL | meow().unknown();
|
||||
| ^^^^^^^ method not found in `Result<(), std::io::Error>`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0599`.
|
||||
|
|
@ -15,7 +15,7 @@ help: consider adjusting the signature so it borrows its argument
|
|||
LL | once::<&str>("str").fuse().filter(|a: &&str| true).count();
|
||||
| +
|
||||
|
||||
error[E0599]: the method `count` exists for struct `Filter<Fuse<Once<&str>>, {closure@issue-36053-2.rs:7:39}>`, but its trait bounds were not satisfied
|
||||
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
|
||||
|
|
||||
LL | once::<&str>("str").fuse().filter(|a: &str| true).count();
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no function or associated item named `make_g` found for fn pointer
|
|||
--> $DIR/issue-57362-2.rs:23:25
|
||||
|
|
||||
LL | let x = <fn (&())>::make_g();
|
||||
| ^^^^^^ function or associated item not found in `fn(&())`
|
||||
| ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `X` defines an item `make_g`, perhaps you need to implement it
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no function or associated item named `make_g` found for fn pointer
|
|||
--> $DIR/issue-57642-higher-ranked-subtype.rs:31:25
|
||||
|
|
||||
LL | let x = <fn (&())>::make_g();
|
||||
| ^^^^^^ function or associated item not found in `fn(&())`
|
||||
| ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `X` defines an item `make_g`, perhaps you need to implement it
|
||||
|
|
@ -15,7 +15,7 @@ error[E0599]: no function or associated item named `make_f` found for fn pointer
|
|||
--> $DIR/issue-57642-higher-ranked-subtype.rs:36:25
|
||||
|
|
||||
LL | let x = <fn (&())>::make_f();
|
||||
| ^^^^^^ function or associated item not found in `fn(&())`
|
||||
| ^^^^^^ function or associated item not found in `for<'a> fn(&'a ())`
|
||||
|
|
||||
= help: items from traits can only be used if the trait is implemented and in scope
|
||||
note: `Y` defines an item `make_f`, perhaps you need to implement it
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ error[E0599]: no method named `managed` found for struct `Box<(dyn Foo + 'static
|
|||
--> $DIR/object-pointer-types.rs:23:7
|
||||
|
|
||||
LL | x.managed();
|
||||
| ^^^^^^^ method not found in `Box<dyn Foo>`
|
||||
| ^^^^^^^ method not found in `Box<(dyn Foo + 'static)>`
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ LL | let fp = BufWriter::new(fp);
|
|||
note: required by a bound in `BufWriter`
|
||||
--> $SRC_DIR/std/src/io/buffered/bufwriter.rs:LL:COL
|
||||
|
||||
error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn Write>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the method `write_fmt` exists for struct `BufWriter<&dyn std::io::Write>`, but its trait bounds were not satisfied
|
||||
--> $DIR/mut-borrow-needed-by-trait.rs:21:14
|
||||
|
|
||||
LL | writeln!(fp, "hello world").unwrap();
|
||||
| ---------^^---------------- method cannot be called on `BufWriter<&dyn Write>` due to unsatisfied trait bounds
|
||||
| ---------^^---------------- method cannot be called on `BufWriter<&dyn std::io::Write>` due to unsatisfied trait bounds
|
||||
|
|
||||
note: must implement `io::Write`, `fmt::Write`, or have a `write_fmt` method
|
||||
--> $DIR/mut-borrow-needed-by-trait.rs:21:14
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `iter` found for reference `&'static str` in the c
|
|||
--> $DIR/suggest-using-chars.rs:2:19
|
||||
|
|
||||
LL | let _ = "foo".iter();
|
||||
| ^^^^ method not found in `&str`
|
||||
| ^^^^ method not found in `&'static str`
|
||||
|
|
||||
help: because of the in-memory representation of `&str`, to obtain an `Iterator` over each of its codepoint use method `chars`
|
||||
|
|
||||
|
|
@ -14,7 +14,7 @@ error[E0599]: no method named `foo` found for reference `&'static str` in the cu
|
|||
--> $DIR/suggest-using-chars.rs:3:19
|
||||
|
|
||||
LL | let _ = "foo".foo();
|
||||
| ^^^ method not found in `&str`
|
||||
| ^^^ method not found in `&'static str`
|
||||
|
||||
error[E0599]: no method named `iter` found for struct `String` in the current scope
|
||||
--> $DIR/suggest-using-chars.rs:4:33
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ LL | | })
|
|||
note: required by a bound in `cloned`
|
||||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
||||
|
||||
error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut IntoIter<u8>, {closure@issue-31173.rs:7:21}>>`, but its trait bounds were not satisfied
|
||||
error[E0599]: the method `collect` exists for struct `Cloned<TakeWhile<&mut std::vec::IntoIter<u8>, {closure@$DIR/issue-31173.rs:7:21: 7:25}>>`, but its trait bounds were not satisfied
|
||||
--> $DIR/issue-31173.rs:12:10
|
||||
|
|
||||
LL | let temp: Vec<u8> = it
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error[E0599]: no method named `call` found for closure `{closure@$DIR/unboxed-cl
|
|||
--> $DIR/unboxed-closures-static-call-wrong-trait.rs:7:10
|
||||
|
|
||||
LL | mut_.call((0, ));
|
||||
| ^^^^ method not found in `{closure@unboxed-closures-static-call-wrong-trait.rs:6:26}`
|
||||
| ^^^^ method not found in `{closure@$DIR/unboxed-closures-static-call-wrong-trait.rs:6:26: 6:29}`
|
||||
|
||||
error: aborting due to 1 previous error
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue