Auto merge of #96363 - matthiaskrgr:rollup-mthdja5, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #94893 (diagnostics: regression test for `<usize as Iterator>::rev`) - #95504 (Add `x {check,build,doc} {compiler,library}` aliases.) - #96237 (compiletest: combine `--*-python` args) - #96303 (Improve bootstrap tests) - #96352 (Improve span for `consider adding an explicit lifetime bound` suggestions under NLL) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
5cdab3a8db
45 changed files with 400 additions and 287 deletions
|
@ -4,6 +4,7 @@ use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed
|
||||||
use rustc_infer::infer::{
|
use rustc_infer::infer::{
|
||||||
error_reporting::nice_region_error::NiceRegionError,
|
error_reporting::nice_region_error::NiceRegionError,
|
||||||
error_reporting::unexpected_hidden_region_diagnostic, NllRegionVariableOrigin,
|
error_reporting::unexpected_hidden_region_diagnostic, NllRegionVariableOrigin,
|
||||||
|
RelateParamBound,
|
||||||
};
|
};
|
||||||
use rustc_middle::hir::place::PlaceBase;
|
use rustc_middle::hir::place::PlaceBase;
|
||||||
use rustc_middle::mir::{ConstraintCategory, ReturnConstraint};
|
use rustc_middle::mir::{ConstraintCategory, ReturnConstraint};
|
||||||
|
@ -166,11 +167,14 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
||||||
let type_test_span = type_test.locations.span(&self.body);
|
let type_test_span = type_test.locations.span(&self.body);
|
||||||
|
|
||||||
if let Some(lower_bound_region) = lower_bound_region {
|
if let Some(lower_bound_region) = lower_bound_region {
|
||||||
|
let generic_ty = type_test.generic_kind.to_ty(self.infcx.tcx);
|
||||||
|
let origin = RelateParamBound(type_test_span, generic_ty, None);
|
||||||
self.buffer_error(self.infcx.construct_generic_bound_failure(
|
self.buffer_error(self.infcx.construct_generic_bound_failure(
|
||||||
type_test_span,
|
type_test_span,
|
||||||
None,
|
Some(origin),
|
||||||
type_test.generic_kind,
|
type_test.generic_kind,
|
||||||
lower_bound_region,
|
lower_bound_region,
|
||||||
|
self.body.source.def_id().as_local(),
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
// FIXME. We should handle this case better. It
|
// FIXME. We should handle this case better. It
|
||||||
|
|
|
@ -61,7 +61,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
||||||
use rustc_errors::{pluralize, struct_span_err, Diagnostic, ErrorGuaranteed};
|
use rustc_errors::{pluralize, struct_span_err, Diagnostic, ErrorGuaranteed};
|
||||||
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString, MultiSpan};
|
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString, MultiSpan};
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
use rustc_hir::def_id::DefId;
|
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||||
use rustc_hir::lang_items::LangItem;
|
use rustc_hir::lang_items::LangItem;
|
||||||
use rustc_hir::{Item, ItemKind, Node};
|
use rustc_hir::{Item, ItemKind, Node};
|
||||||
use rustc_middle::dep_graph::DepContext;
|
use rustc_middle::dep_graph::DepContext;
|
||||||
|
@ -2285,7 +2285,9 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
bound_kind: GenericKind<'tcx>,
|
bound_kind: GenericKind<'tcx>,
|
||||||
sub: Region<'tcx>,
|
sub: Region<'tcx>,
|
||||||
) {
|
) {
|
||||||
self.construct_generic_bound_failure(span, origin, bound_kind, sub).emit();
|
let owner =
|
||||||
|
self.in_progress_typeck_results.map(|typeck_results| typeck_results.borrow().hir_owner);
|
||||||
|
self.construct_generic_bound_failure(span, origin, bound_kind, sub, owner).emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn construct_generic_bound_failure(
|
pub fn construct_generic_bound_failure(
|
||||||
|
@ -2294,31 +2296,29 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
origin: Option<SubregionOrigin<'tcx>>,
|
origin: Option<SubregionOrigin<'tcx>>,
|
||||||
bound_kind: GenericKind<'tcx>,
|
bound_kind: GenericKind<'tcx>,
|
||||||
sub: Region<'tcx>,
|
sub: Region<'tcx>,
|
||||||
|
owner: Option<LocalDefId>,
|
||||||
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
) -> DiagnosticBuilder<'a, ErrorGuaranteed> {
|
||||||
let hir = self.tcx.hir();
|
let hir = self.tcx.hir();
|
||||||
// Attempt to obtain the span of the parameter so we can
|
// Attempt to obtain the span of the parameter so we can
|
||||||
// suggest adding an explicit lifetime bound to it.
|
// suggest adding an explicit lifetime bound to it.
|
||||||
let generics = self
|
let generics = owner.map(|owner| {
|
||||||
.in_progress_typeck_results
|
let hir_id = hir.local_def_id_to_hir_id(owner);
|
||||||
.map(|typeck_results| typeck_results.borrow().hir_owner)
|
let parent_id = hir.get_parent_item(hir_id);
|
||||||
.map(|owner| {
|
(
|
||||||
let hir_id = hir.local_def_id_to_hir_id(owner);
|
// Parent item could be a `mod`, so we check the HIR before calling:
|
||||||
let parent_id = hir.get_parent_item(hir_id);
|
if let Some(Node::Item(Item {
|
||||||
(
|
kind: ItemKind::Trait(..) | ItemKind::Impl { .. },
|
||||||
// Parent item could be a `mod`, so we check the HIR before calling:
|
..
|
||||||
if let Some(Node::Item(Item {
|
})) = hir.find_by_def_id(parent_id)
|
||||||
kind: ItemKind::Trait(..) | ItemKind::Impl { .. },
|
{
|
||||||
..
|
Some(self.tcx.generics_of(parent_id))
|
||||||
})) = hir.find_by_def_id(parent_id)
|
} else {
|
||||||
{
|
None
|
||||||
Some(self.tcx.generics_of(parent_id))
|
},
|
||||||
} else {
|
self.tcx.generics_of(owner.to_def_id()),
|
||||||
None
|
hir.span(hir_id),
|
||||||
},
|
)
|
||||||
self.tcx.generics_of(owner.to_def_id()),
|
});
|
||||||
hir.span(hir_id),
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
let span = match generics {
|
let span = match generics {
|
||||||
// This is to get around the trait identity obligation, that has a `DUMMY_SP` as signal
|
// This is to get around the trait identity obligation, that has a `DUMMY_SP` as signal
|
||||||
|
@ -2606,11 +2606,8 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
if let Some(infer::RelateParamBound(_, t, _)) = origin {
|
if let Some(infer::RelateParamBound(_, t, _)) = origin {
|
||||||
let return_impl_trait = self
|
let return_impl_trait =
|
||||||
.in_progress_typeck_results
|
owner.and_then(|owner| self.tcx.return_type_impl_trait(owner)).is_some();
|
||||||
.map(|typeck_results| typeck_results.borrow().hir_owner)
|
|
||||||
.and_then(|owner| self.tcx.return_type_impl_trait(owner))
|
|
||||||
.is_some();
|
|
||||||
let t = self.resolve_vars_if_possible(t);
|
let t = self.resolve_vars_if_possible(t);
|
||||||
match t.kind() {
|
match t.kind() {
|
||||||
// We've got:
|
// We've got:
|
||||||
|
|
|
@ -7,6 +7,7 @@ fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config {
|
||||||
// don't save toolstates
|
// don't save toolstates
|
||||||
config.save_toolstates = None;
|
config.save_toolstates = None;
|
||||||
config.dry_run = true;
|
config.dry_run = true;
|
||||||
|
config.submodules = Some(false);
|
||||||
config.ninja_in_file = false;
|
config.ninja_in_file = false;
|
||||||
// try to avoid spurious failures in dist where we create/delete each others file
|
// try to avoid spurious failures in dist where we create/delete each others file
|
||||||
// HACK: rather than pull in `tempdir`, use the one that cargo has conveniently created for us
|
// HACK: rather than pull in `tempdir`, use the one that cargo has conveniently created for us
|
||||||
|
@ -25,36 +26,74 @@ fn first<A, B>(v: Vec<(A, B)>) -> Vec<A> {
|
||||||
v.into_iter().map(|(a, _)| a).collect::<Vec<_>>()
|
v.into_iter().map(|(a, _)| a).collect::<Vec<_>>()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn run_build(paths: &[PathBuf], config: Config) -> Cache {
|
||||||
|
let kind = config.cmd.kind();
|
||||||
|
let build = Build::new(config);
|
||||||
|
let builder = Builder::new(&build);
|
||||||
|
builder.run_step_descriptions(&Builder::get_step_descriptions(kind), paths);
|
||||||
|
builder.cache
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_exclude() {
|
||||||
|
let mut config = configure("test", &["A"], &["A"]);
|
||||||
|
config.exclude = vec![TaskPath::parse("src/tools/tidy")];
|
||||||
|
let cache = run_build(&[], config);
|
||||||
|
|
||||||
|
// Ensure we have really excluded tidy
|
||||||
|
assert!(!cache.contains::<test::Tidy>());
|
||||||
|
|
||||||
|
// Ensure other tests are not affected.
|
||||||
|
assert!(cache.contains::<test::RustdocUi>());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_exclude_kind() {
|
||||||
|
let path = PathBuf::from("src/tools/cargotest");
|
||||||
|
let exclude = TaskPath::parse("test::src/tools/cargotest");
|
||||||
|
assert_eq!(exclude, TaskPath { kind: Some(Kind::Test), path: path.clone() });
|
||||||
|
|
||||||
|
let mut config = configure("test", &["A"], &["A"]);
|
||||||
|
// Ensure our test is valid, and `test::Cargotest` would be run without the exclude.
|
||||||
|
assert!(run_build(&[path.clone()], config.clone()).contains::<test::Cargotest>());
|
||||||
|
// Ensure tests for cargotest are skipped.
|
||||||
|
config.exclude = vec![exclude.clone()];
|
||||||
|
assert!(!run_build(&[path.clone()], config).contains::<test::Cargotest>());
|
||||||
|
|
||||||
|
// Ensure builds for cargotest are not skipped.
|
||||||
|
let mut config = configure("build", &["A"], &["A"]);
|
||||||
|
config.exclude = vec![exclude];
|
||||||
|
assert!(run_build(&[path], config).contains::<tool::CargoTest>());
|
||||||
|
}
|
||||||
|
|
||||||
mod defaults {
|
mod defaults {
|
||||||
use super::{configure, first};
|
use super::{configure, first, run_build};
|
||||||
use crate::builder::*;
|
use crate::builder::*;
|
||||||
use crate::Config;
|
use crate::Config;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn build_default() {
|
fn build_default() {
|
||||||
let build = Build::new(configure("build", &["A"], &["A"]));
|
let mut cache = run_build(&[], configure("build", &["A"], &["A"]));
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Std>()),
|
first(cache.all::<compile::Std>()),
|
||||||
&[
|
&[
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert!(!builder.cache.all::<compile::Assemble>().is_empty());
|
assert!(!cache.all::<compile::Assemble>().is_empty());
|
||||||
// Make sure rustdoc is only built once.
|
// Make sure rustdoc is only built once.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<tool::Rustdoc>()),
|
first(cache.all::<tool::Rustdoc>()),
|
||||||
// Recall that rustdoc stages are off-by-one
|
// Recall that rustdoc stages are off-by-one
|
||||||
// - this is the compiler it's _linked_ to, not built with.
|
// - this is the compiler it's _linked_ to, not built with.
|
||||||
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }],
|
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }],
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Rustc>()),
|
first(cache.all::<compile::Rustc>()),
|
||||||
&[compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },]
|
&[compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -62,31 +101,27 @@ mod defaults {
|
||||||
#[test]
|
#[test]
|
||||||
fn build_stage_0() {
|
fn build_stage_0() {
|
||||||
let config = Config { stage: 0, ..configure("build", &["A"], &["A"]) };
|
let config = Config { stage: 0, ..configure("build", &["A"], &["A"]) };
|
||||||
let build = Build::new(config);
|
let mut cache = run_build(&[], config);
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Std>()),
|
first(cache.all::<compile::Std>()),
|
||||||
&[compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },]
|
&[compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },]
|
||||||
);
|
);
|
||||||
assert!(!builder.cache.all::<compile::Assemble>().is_empty());
|
assert!(!cache.all::<compile::Assemble>().is_empty());
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<tool::Rustdoc>()),
|
first(cache.all::<tool::Rustdoc>()),
|
||||||
// This is the beta rustdoc.
|
// This is the beta rustdoc.
|
||||||
// Add an assert here to make sure this is the only rustdoc built.
|
// Add an assert here to make sure this is the only rustdoc built.
|
||||||
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } }],
|
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } }],
|
||||||
);
|
);
|
||||||
assert!(builder.cache.all::<compile::Rustc>().is_empty());
|
assert!(cache.all::<compile::Rustc>().is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn build_cross_compile() {
|
fn build_cross_compile() {
|
||||||
let config = Config { stage: 1, ..configure("build", &["A", "B"], &["A", "B"]) };
|
let config = Config { stage: 1, ..configure("build", &["A", "B"], &["A", "B"]) };
|
||||||
let build = Build::new(config);
|
let mut cache = run_build(&[], config);
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
let b = TargetSelection::from_user("B");
|
let b = TargetSelection::from_user("B");
|
||||||
|
@ -97,7 +132,7 @@ mod defaults {
|
||||||
// (since we're producing stage 1 libraries/binaries). But currently
|
// (since we're producing stage 1 libraries/binaries). But currently
|
||||||
// rustbuild is just a bit buggy here; this should be fixed though.
|
// rustbuild is just a bit buggy here; this should be fixed though.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Std>()),
|
first(cache.all::<compile::Std>()),
|
||||||
&[
|
&[
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
|
@ -106,7 +141,7 @@ mod defaults {
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Assemble>()),
|
first(cache.all::<compile::Assemble>()),
|
||||||
&[
|
&[
|
||||||
compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
|
compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
|
||||||
compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } },
|
compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } },
|
||||||
|
@ -114,14 +149,14 @@ mod defaults {
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<tool::Rustdoc>()),
|
first(cache.all::<tool::Rustdoc>()),
|
||||||
&[
|
&[
|
||||||
tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } },
|
tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } },
|
||||||
tool::Rustdoc { compiler: Compiler { host: b, stage: 1 } },
|
tool::Rustdoc { compiler: Compiler { host: b, stage: 1 } },
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Rustc>()),
|
first(cache.all::<compile::Rustc>()),
|
||||||
&[
|
&[
|
||||||
compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },
|
compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },
|
||||||
compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: b },
|
compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: b },
|
||||||
|
@ -134,33 +169,28 @@ mod defaults {
|
||||||
let mut config = configure("doc", &["A"], &["A"]);
|
let mut config = configure("doc", &["A"], &["A"]);
|
||||||
config.compiler_docs = true;
|
config.compiler_docs = true;
|
||||||
config.cmd = Subcommand::Doc { paths: Vec::new(), open: false };
|
config.cmd = Subcommand::Doc { paths: Vec::new(), open: false };
|
||||||
let build = Build::new(config);
|
let mut cache = run_build(&[], config);
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Doc), &[]);
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
|
|
||||||
// error_index_generator uses stage 0 to share rustdoc artifacts with the
|
// error_index_generator uses stage 0 to share rustdoc artifacts with the
|
||||||
// rustdoc tool.
|
// rustdoc tool.
|
||||||
|
assert_eq!(first(cache.all::<doc::ErrorIndex>()), &[doc::ErrorIndex { target: a },]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<doc::ErrorIndex>()),
|
first(cache.all::<tool::ErrorIndex>()),
|
||||||
&[doc::ErrorIndex { target: a },]
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
first(builder.cache.all::<tool::ErrorIndex>()),
|
|
||||||
&[tool::ErrorIndex { compiler: Compiler { host: a, stage: 0 } }]
|
&[tool::ErrorIndex { compiler: Compiler { host: a, stage: 0 } }]
|
||||||
);
|
);
|
||||||
// docs should be built with the beta compiler, not with the stage0 artifacts.
|
// docs should be built with the beta compiler, not with the stage0 artifacts.
|
||||||
// recall that rustdoc is off-by-one: `stage` is the compiler rustdoc is _linked_ to,
|
// recall that rustdoc is off-by-one: `stage` is the compiler rustdoc is _linked_ to,
|
||||||
// not the one it was built by.
|
// not the one it was built by.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<tool::Rustdoc>()),
|
first(cache.all::<tool::Rustdoc>()),
|
||||||
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } },]
|
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } },]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mod dist {
|
mod dist {
|
||||||
use super::{first, Config};
|
use super::{first, run_build, Config};
|
||||||
use crate::builder::*;
|
use crate::builder::*;
|
||||||
use pretty_assertions::assert_eq;
|
use pretty_assertions::assert_eq;
|
||||||
|
|
||||||
|
@ -170,94 +200,88 @@ mod dist {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dist_baseline() {
|
fn dist_baseline() {
|
||||||
let build = Build::new(configure(&["A"], &["A"]));
|
let mut cache = run_build(&[], configure(&["A"], &["A"]));
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
|
|
||||||
assert_eq!(first(builder.cache.all::<dist::Docs>()), &[dist::Docs { host: a },]);
|
assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a },]);
|
||||||
assert_eq!(first(builder.cache.all::<dist::Mingw>()), &[dist::Mingw { host: a },]);
|
assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: a },]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Rustc>()),
|
first(cache.all::<dist::Rustc>()),
|
||||||
&[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },]
|
&[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Std>()),
|
first(cache.all::<dist::Std>()),
|
||||||
&[dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },]
|
&[dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },]
|
||||||
);
|
);
|
||||||
assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
|
assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]);
|
||||||
// Make sure rustdoc is only built once.
|
// Make sure rustdoc is only built once.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<tool::Rustdoc>()),
|
first(cache.all::<tool::Rustdoc>()),
|
||||||
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
|
&[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dist_with_targets() {
|
fn dist_with_targets() {
|
||||||
let build = Build::new(configure(&["A"], &["A", "B"]));
|
let mut cache = run_build(&[], configure(&["A"], &["A", "B"]));
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
let b = TargetSelection::from_user("B");
|
let b = TargetSelection::from_user("B");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Docs>()),
|
first(cache.all::<dist::Docs>()),
|
||||||
&[dist::Docs { host: a }, dist::Docs { host: b },]
|
&[dist::Docs { host: a }, dist::Docs { host: b },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Mingw>()),
|
first(cache.all::<dist::Mingw>()),
|
||||||
&[dist::Mingw { host: a }, dist::Mingw { host: b },]
|
&[dist::Mingw { host: a }, dist::Mingw { host: b },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Rustc>()),
|
first(cache.all::<dist::Rustc>()),
|
||||||
&[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },]
|
&[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Std>()),
|
first(cache.all::<dist::Std>()),
|
||||||
&[
|
&[
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
|
dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
|
assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dist_with_hosts() {
|
fn dist_with_hosts() {
|
||||||
let build = Build::new(configure(&["A", "B"], &["A", "B"]));
|
let mut cache = run_build(&[], configure(&["A", "B"], &["A", "B"]));
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
let b = TargetSelection::from_user("B");
|
let b = TargetSelection::from_user("B");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Docs>()),
|
first(cache.all::<dist::Docs>()),
|
||||||
&[dist::Docs { host: a }, dist::Docs { host: b },]
|
&[dist::Docs { host: a }, dist::Docs { host: b },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Mingw>()),
|
first(cache.all::<dist::Mingw>()),
|
||||||
&[dist::Mingw { host: a }, dist::Mingw { host: b },]
|
&[dist::Mingw { host: a }, dist::Mingw { host: b },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Rustc>()),
|
first(cache.all::<dist::Rustc>()),
|
||||||
&[
|
&[
|
||||||
dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
|
dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
|
||||||
dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
|
dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Std>()),
|
first(cache.all::<dist::Std>()),
|
||||||
&[
|
&[
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
|
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Std>()),
|
first(cache.all::<compile::Std>()),
|
||||||
&[
|
&[
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
|
@ -266,26 +290,25 @@ mod dist {
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
|
compile::Std { compiler: Compiler { host: a, stage: 2 }, target: b },
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
|
assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dist_only_cross_host() {
|
fn dist_only_cross_host() {
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
let b = TargetSelection::from_user("B");
|
let b = TargetSelection::from_user("B");
|
||||||
let mut build = Build::new(configure(&["A", "B"], &["A", "B"]));
|
let mut config = configure(&["A", "B"], &["A", "B"]);
|
||||||
build.config.docs = false;
|
config.docs = false;
|
||||||
build.config.extended = true;
|
config.extended = true;
|
||||||
build.hosts = vec![b];
|
config.hosts = vec![b];
|
||||||
let mut builder = Builder::new(&build);
|
let mut cache = run_build(&[], config);
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Rustc>()),
|
first(cache.all::<dist::Rustc>()),
|
||||||
&[dist::Rustc { compiler: Compiler { host: b, stage: 2 } },]
|
&[dist::Rustc { compiler: Compiler { host: b, stage: 2 } },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Rustc>()),
|
first(cache.all::<compile::Rustc>()),
|
||||||
&[
|
&[
|
||||||
compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },
|
compile::Rustc { compiler: Compiler { host: a, stage: 0 }, target: a },
|
||||||
compile::Rustc { compiler: Compiler { host: a, stage: 1 }, target: b },
|
compile::Rustc { compiler: Compiler { host: a, stage: 1 }, target: b },
|
||||||
|
@ -295,92 +318,86 @@ mod dist {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dist_with_targets_and_hosts() {
|
fn dist_with_targets_and_hosts() {
|
||||||
let build = Build::new(configure(&["A", "B"], &["A", "B", "C"]));
|
let mut cache = run_build(&[], configure(&["A", "B"], &["A", "B", "C"]));
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
let b = TargetSelection::from_user("B");
|
let b = TargetSelection::from_user("B");
|
||||||
let c = TargetSelection::from_user("C");
|
let c = TargetSelection::from_user("C");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Docs>()),
|
first(cache.all::<dist::Docs>()),
|
||||||
&[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },]
|
&[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Mingw>()),
|
first(cache.all::<dist::Mingw>()),
|
||||||
&[dist::Mingw { host: a }, dist::Mingw { host: b }, dist::Mingw { host: c },]
|
&[dist::Mingw { host: a }, dist::Mingw { host: b }, dist::Mingw { host: c },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Rustc>()),
|
first(cache.all::<dist::Rustc>()),
|
||||||
&[
|
&[
|
||||||
dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
|
dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
|
||||||
dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
|
dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Std>()),
|
first(cache.all::<dist::Std>()),
|
||||||
&[
|
&[
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
|
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },
|
dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
|
assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dist_with_empty_host() {
|
fn dist_with_empty_host() {
|
||||||
let config = configure(&[], &["C"]);
|
let config = configure(&[], &["C"]);
|
||||||
let build = Build::new(config);
|
let mut cache = run_build(&[], config);
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
let c = TargetSelection::from_user("C");
|
let c = TargetSelection::from_user("C");
|
||||||
|
|
||||||
assert_eq!(first(builder.cache.all::<dist::Docs>()), &[dist::Docs { host: c },]);
|
assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: c },]);
|
||||||
assert_eq!(first(builder.cache.all::<dist::Mingw>()), &[dist::Mingw { host: c },]);
|
assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: c },]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Std>()),
|
first(cache.all::<dist::Std>()),
|
||||||
&[dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },]
|
&[dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn dist_with_same_targets_and_hosts() {
|
fn dist_with_same_targets_and_hosts() {
|
||||||
let build = Build::new(configure(&["A", "B"], &["A", "B"]));
|
let mut cache = run_build(&[], configure(&["A", "B"], &["A", "B"]));
|
||||||
let mut builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Dist), &[]);
|
|
||||||
|
|
||||||
let a = TargetSelection::from_user("A");
|
let a = TargetSelection::from_user("A");
|
||||||
let b = TargetSelection::from_user("B");
|
let b = TargetSelection::from_user("B");
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Docs>()),
|
first(cache.all::<dist::Docs>()),
|
||||||
&[dist::Docs { host: a }, dist::Docs { host: b },]
|
&[dist::Docs { host: a }, dist::Docs { host: b },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Mingw>()),
|
first(cache.all::<dist::Mingw>()),
|
||||||
&[dist::Mingw { host: a }, dist::Mingw { host: b },]
|
&[dist::Mingw { host: a }, dist::Mingw { host: b },]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Rustc>()),
|
first(cache.all::<dist::Rustc>()),
|
||||||
&[
|
&[
|
||||||
dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
|
dist::Rustc { compiler: Compiler { host: a, stage: 2 } },
|
||||||
dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
|
dist::Rustc { compiler: Compiler { host: b, stage: 2 } },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<dist::Std>()),
|
first(cache.all::<dist::Std>()),
|
||||||
&[
|
&[
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
|
dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b },
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(first(builder.cache.all::<dist::Src>()), &[dist::Src]);
|
assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Std>()),
|
first(cache.all::<compile::Std>()),
|
||||||
&[
|
&[
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 0 }, target: a },
|
||||||
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
compile::Std { compiler: Compiler { host: a, stage: 1 }, target: a },
|
||||||
|
@ -390,7 +407,7 @@ mod dist {
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
first(builder.cache.all::<compile::Assemble>()),
|
first(cache.all::<compile::Assemble>()),
|
||||||
&[
|
&[
|
||||||
compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
|
compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } },
|
||||||
compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } },
|
compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } },
|
||||||
|
@ -514,35 +531,6 @@ mod dist {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn test_exclude() {
|
|
||||||
let mut config = configure(&["A"], &["A"]);
|
|
||||||
config.exclude = vec![TaskPath::parse("src/tools/tidy")];
|
|
||||||
config.cmd = Subcommand::Test {
|
|
||||||
paths: Vec::new(),
|
|
||||||
test_args: Vec::new(),
|
|
||||||
rustc_args: Vec::new(),
|
|
||||||
fail_fast: true,
|
|
||||||
doc_tests: DocTests::No,
|
|
||||||
bless: false,
|
|
||||||
force_rerun: false,
|
|
||||||
compare_mode: None,
|
|
||||||
rustfix_coverage: false,
|
|
||||||
pass: None,
|
|
||||||
run: None,
|
|
||||||
};
|
|
||||||
|
|
||||||
let build = Build::new(config);
|
|
||||||
let builder = Builder::new(&build);
|
|
||||||
builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Test), &[]);
|
|
||||||
|
|
||||||
// Ensure we have really excluded tidy
|
|
||||||
assert!(!builder.cache.contains::<test::Tidy>());
|
|
||||||
|
|
||||||
// Ensure other tests are not affected.
|
|
||||||
assert!(builder.cache.contains::<test::RustdocUi>());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn doc_ci() {
|
fn doc_ci() {
|
||||||
let mut config = configure(&["A"], &["A"]);
|
let mut config = configure(&["A"], &["A"]);
|
||||||
|
|
|
@ -64,7 +64,7 @@ impl Step for Std {
|
||||||
const DEFAULT: bool = true;
|
const DEFAULT: bool = true;
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
run.all_krates("test")
|
run.all_krates("test").path("library")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
fn make_run(run: RunConfig<'_>) {
|
||||||
|
@ -162,7 +162,7 @@ impl Step for Rustc {
|
||||||
const DEFAULT: bool = true;
|
const DEFAULT: bool = true;
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
run.all_krates("rustc-main")
|
run.all_krates("rustc-main").path("compiler")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
fn make_run(run: RunConfig<'_>) {
|
||||||
|
|
|
@ -43,7 +43,7 @@ impl Step for Std {
|
||||||
// When downloading stage1, the standard library has already been copied to the sysroot, so
|
// When downloading stage1, the standard library has already been copied to the sysroot, so
|
||||||
// there's no need to rebuild it.
|
// there's no need to rebuild it.
|
||||||
let download_rustc = run.builder.config.download_rustc;
|
let download_rustc = run.builder.config.download_rustc;
|
||||||
run.all_krates("test").default_condition(!download_rustc)
|
run.all_krates("test").path("library").default_condition(!download_rustc)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
fn make_run(run: RunConfig<'_>) {
|
||||||
|
@ -1047,7 +1047,7 @@ impl Step for Assemble {
|
||||||
const ONLY_HOSTS: bool = true;
|
const ONLY_HOSTS: bool = true;
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
run.path("compiler/rustc")
|
run.path("compiler/rustc").path("compiler")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
fn make_run(run: RunConfig<'_>) {
|
||||||
|
|
|
@ -41,6 +41,7 @@ macro_rules! check_ci_llvm {
|
||||||
/// each field, see the corresponding fields in
|
/// each field, see the corresponding fields in
|
||||||
/// `config.toml.example`.
|
/// `config.toml.example`.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
#[cfg_attr(test, derive(Clone))]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
pub changelog_seen: Option<usize>,
|
pub changelog_seen: Option<usize>,
|
||||||
pub ccache: Option<String>,
|
pub ccache: Option<String>,
|
||||||
|
@ -330,6 +331,7 @@ impl PartialEq<&str> for TargetSelection {
|
||||||
|
|
||||||
/// Per-target configuration stored in the global configuration structure.
|
/// Per-target configuration stored in the global configuration structure.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
#[cfg_attr(test, derive(Clone))]
|
||||||
pub struct Target {
|
pub struct Target {
|
||||||
/// Some(path to llvm-config) if using an external LLVM.
|
/// Some(path to llvm-config) if using an external LLVM.
|
||||||
pub llvm_config: Option<PathBuf>,
|
pub llvm_config: Option<PathBuf>,
|
||||||
|
|
|
@ -416,7 +416,7 @@ impl Step for Std {
|
||||||
|
|
||||||
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
|
||||||
let builder = run.builder;
|
let builder = run.builder;
|
||||||
run.all_krates("test").default_condition(builder.config.docs)
|
run.all_krates("test").path("library").default_condition(builder.config.docs)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn make_run(run: RunConfig<'_>) {
|
fn make_run(run: RunConfig<'_>) {
|
||||||
|
@ -477,11 +477,14 @@ impl Step for Std {
|
||||||
.iter()
|
.iter()
|
||||||
.map(components_simplified)
|
.map(components_simplified)
|
||||||
.filter_map(|path| {
|
.filter_map(|path| {
|
||||||
if path.get(0) == Some(&"library") {
|
if path.len() >= 2 && path.get(0) == Some(&"library") {
|
||||||
|
// single crate
|
||||||
Some(path[1].to_owned())
|
Some(path[1].to_owned())
|
||||||
} else if !path.is_empty() {
|
} else if !path.is_empty() {
|
||||||
|
// ??
|
||||||
Some(path[0].to_owned())
|
Some(path[0].to_owned())
|
||||||
} else {
|
} else {
|
||||||
|
// all library crates
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -14,6 +14,7 @@ use crate::setup::Profile;
|
||||||
use crate::util::t;
|
use crate::util::t;
|
||||||
use crate::{Build, DocTests};
|
use crate::{Build, DocTests};
|
||||||
|
|
||||||
|
#[derive(Copy, Clone)]
|
||||||
pub enum Color {
|
pub enum Color {
|
||||||
Always,
|
Always,
|
||||||
Never,
|
Never,
|
||||||
|
@ -79,6 +80,7 @@ pub struct Flags {
|
||||||
pub llvm_profile_generate: bool,
|
pub llvm_profile_generate: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg_attr(test, derive(Clone))]
|
||||||
pub enum Subcommand {
|
pub enum Subcommand {
|
||||||
Build {
|
Build {
|
||||||
paths: Vec<PathBuf>,
|
paths: Vec<PathBuf>,
|
||||||
|
@ -668,6 +670,24 @@ Arguments:
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Subcommand {
|
impl Subcommand {
|
||||||
|
pub fn kind(&self) -> Kind {
|
||||||
|
match self {
|
||||||
|
Subcommand::Bench { .. } => Kind::Bench,
|
||||||
|
Subcommand::Build { .. } => Kind::Build,
|
||||||
|
Subcommand::Check { .. } => Kind::Check,
|
||||||
|
Subcommand::Clippy { .. } => Kind::Clippy,
|
||||||
|
Subcommand::Doc { .. } => Kind::Doc,
|
||||||
|
Subcommand::Fix { .. } => Kind::Fix,
|
||||||
|
Subcommand::Format { .. } => Kind::Format,
|
||||||
|
Subcommand::Test { .. } => Kind::Test,
|
||||||
|
Subcommand::Clean { .. } => Kind::Clean,
|
||||||
|
Subcommand::Dist { .. } => Kind::Dist,
|
||||||
|
Subcommand::Install { .. } => Kind::Install,
|
||||||
|
Subcommand::Run { .. } => Kind::Run,
|
||||||
|
Subcommand::Setup { .. } => Kind::Setup,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub fn test_args(&self) -> Vec<&str> {
|
pub fn test_args(&self) -> Vec<&str> {
|
||||||
match *self {
|
match *self {
|
||||||
Subcommand::Test { ref test_args, .. } | Subcommand::Bench { ref test_args, .. } => {
|
Subcommand::Test { ref test_args, .. } | Subcommand::Bench { ref test_args, .. } => {
|
||||||
|
|
|
@ -1400,9 +1400,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
|
||||||
targetflags.extend(builder.lld_flags(target));
|
targetflags.extend(builder.lld_flags(target));
|
||||||
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
|
cmd.arg("--target-rustcflags").arg(targetflags.join(" "));
|
||||||
|
|
||||||
cmd.arg("--docck-python").arg(builder.python());
|
cmd.arg("--python").arg(builder.python());
|
||||||
|
|
||||||
cmd.arg("--lldb-python").arg(builder.python());
|
|
||||||
|
|
||||||
if let Some(ref gdb) = builder.config.gdb {
|
if let Some(ref gdb) = builder.config.gdb {
|
||||||
cmd.arg("--gdb").arg(gdb);
|
cmd.arg("--gdb").arg(gdb);
|
||||||
|
|
|
@ -82,10 +82,11 @@ LL | fn move_lifetime_into_fn<'a, 'b>(x: &'a u32, y: &'b u32) -> impl Fn(&'a u32
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/must_outlive_least_region_or_bound.rs:41:5
|
--> $DIR/must_outlive_least_region_or_bound.rs:41:5
|
||||||
|
|
|
|
||||||
|
LL | fn ty_param_wont_outlive_static<T:Debug>(x: T) -> impl Debug + 'static {
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `T: 'static +`
|
||||||
|
...
|
||||||
LL | x
|
LL | x
|
||||||
| ^
|
| ^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error: aborting due to 9 previous errors
|
error: aborting due to 9 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/type_parameters_captured.rs:10:5
|
--> $DIR/type_parameters_captured.rs:10:5
|
||||||
|
|
|
|
||||||
|
LL | fn foo<T>(x: T) -> impl Any + 'static {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
|
...
|
||||||
LL | x
|
LL | x
|
||||||
| ^
|
| ^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/issue_74400.rs:12:5
|
--> $DIR/issue_74400.rs:12:5
|
||||||
|
|
|
|
||||||
|
LL | fn g<T>(data: &[T]) {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
LL | f(data, identity)
|
LL | f(data, identity)
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error[E0308]: mismatched types
|
error[E0308]: mismatched types
|
||||||
--> $DIR/issue_74400.rs:12:5
|
--> $DIR/issue_74400.rs:12:5
|
||||||
|
|
7
src/test/ui/methods/issues/issue-90315.rs
Normal file
7
src/test/ui/methods/issues/issue-90315.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
fn main() {
|
||||||
|
let arr = &[0,1,2,3];
|
||||||
|
for _i in 0..arr.len().rev() { //~ERROR not an iterator
|
||||||
|
// The above error used to say “the method `rev` exists for type `usize`”.
|
||||||
|
// This regression test ensures it doesn't say that any more.
|
||||||
|
}
|
||||||
|
}
|
13
src/test/ui/methods/issues/issue-90315.stderr
Normal file
13
src/test/ui/methods/issues/issue-90315.stderr
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
error[E0599]: `usize` is not an iterator
|
||||||
|
--> $DIR/issue-90315.rs:3:26
|
||||||
|
|
|
||||||
|
LL | for _i in 0..arr.len().rev() {
|
||||||
|
| ^^^ `usize` is not an iterator
|
||||||
|
|
|
||||||
|
= note: the following trait bounds were not satisfied:
|
||||||
|
`usize: Iterator`
|
||||||
|
which is required by `&mut usize: Iterator`
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0599`.
|
|
@ -36,6 +36,9 @@ LL | | }
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/propagate-from-trait-match.rs:32:36
|
--> $DIR/propagate-from-trait-match.rs:32:36
|
||||||
|
|
|
|
||||||
|
LL | fn supply<'a, T>(value: T)
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | establish_relationships(value, |value| {
|
LL | establish_relationships(value, |value| {
|
||||||
| ____________________________________^
|
| ____________________________________^
|
||||||
LL | |
|
LL | |
|
||||||
|
@ -44,9 +47,7 @@ LL | | // This function call requires that
|
||||||
... |
|
... |
|
||||||
LL | | require(value);
|
LL | | require(value);
|
||||||
LL | | });
|
LL | | });
|
||||||
| |_____^
|
| |_____^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/impl-trait-outlives.rs:11:5
|
--> $DIR/impl-trait-outlives.rs:11:5
|
||||||
|
|
|
|
||||||
|
LL | fn no_region<'a, T>(x: Box<T>) -> impl Debug + 'a
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | x
|
LL | x
|
||||||
| ^
|
| ^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/impl-trait-outlives.rs:26:5
|
--> $DIR/impl-trait-outlives.rs:26:5
|
||||||
|
|
|
|
||||||
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> impl Debug + 'a
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | x
|
LL | x
|
||||||
| ^
|
| ^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/projection-implied-bounds.rs:30:18
|
--> $DIR/projection-implied-bounds.rs:30:18
|
||||||
|
|
|
|
||||||
|
LL | fn generic2<T: Iterator>(value: T) {
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `T: 'static +`
|
||||||
LL | twice(value, |value_ref, item| invoke2(value_ref, item));
|
LL | twice(value, |value_ref, item| invoke2(value_ref, item));
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -33,6 +33,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
||||||
|
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
note: external requirements
|
note: external requirements
|
||||||
--> $DIR/projection-no-regions-closure.rs:34:23
|
--> $DIR/projection-no-regions-closure.rs:34:23
|
||||||
|
@ -96,6 +97,7 @@ LL | with_signature(x, |mut y| Box::new(y.next()))
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
||||||
|
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
note: external requirements
|
note: external requirements
|
||||||
--> $DIR/projection-no-regions-closure.rs:52:23
|
--> $DIR/projection-no-regions-closure.rs:52:23
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | Box::new(x.next())
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
||||||
|
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
|
error[E0309]: the associated type `<T as Iterator>::Item` may not live long enough
|
||||||
--> $DIR/projection-no-regions-fn.rs:28:5
|
--> $DIR/projection-no-regions-fn.rs:28:5
|
||||||
|
@ -13,6 +14,7 @@ LL | Box::new(x.next())
|
||||||
| ^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Iterator>::Item: 'a`...
|
||||||
|
= note: ...so that the type `<T as Iterator>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,11 @@ LL | | }
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/projection-one-region-closure.rs:45:29
|
--> $DIR/projection-one-region-closure.rs:45:29
|
||||||
|
|
|
|
||||||
|
LL | fn no_relationships_late<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/projection-one-region-closure.rs:45:39
|
--> $DIR/projection-one-region-closure.rs:45:39
|
||||||
|
@ -81,10 +82,11 @@ LL | | }
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/projection-one-region-closure.rs:56:29
|
--> $DIR/projection-one-region-closure.rs:56:29
|
||||||
|
|
|
|
||||||
|
LL | fn no_relationships_early<'a, 'b, T>(cell: Cell<&'a ()>, t: T)
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
LL | with_signature(cell, t, |cell, t| require(cell, t));
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/projection-one-region-closure.rs:56:39
|
--> $DIR/projection-one-region-closure.rs:56:39
|
||||||
|
|
|
@ -34,6 +34,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Anything<ReEarlyBound(0, 'b), ReEarlyBound(1, 'c)>>::AssocType: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Anything<ReEarlyBound(0, 'b), ReEarlyBound(1, 'c)>>::AssocType: 'a`...
|
||||||
|
= note: ...so that the type `<T as Anything<ReEarlyBound(0, 'b), ReEarlyBound(1, 'c)>>::AssocType` will meet its required lifetime bounds
|
||||||
|
|
||||||
note: external requirements
|
note: external requirements
|
||||||
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
|
--> $DIR/projection-two-region-trait-bound-closure.rs:48:29
|
||||||
|
@ -70,6 +71,7 @@ LL | with_signature(cell, t, |cell, t| require(cell, t));
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Anything<ReEarlyBound(1, 'b), ReEarlyBound(2, 'c)>>::AssocType: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Anything<ReEarlyBound(1, 'b), ReEarlyBound(2, 'c)>>::AssocType: 'a`...
|
||||||
|
= note: ...so that the type `<T as Anything<ReEarlyBound(1, 'b), ReEarlyBound(2, 'c)>>::AssocType` will meet its required lifetime bounds
|
||||||
|
|
||||||
note: external requirements
|
note: external requirements
|
||||||
--> $DIR/projection-two-region-trait-bound-closure.rs:61:29
|
--> $DIR/projection-two-region-trait-bound-closure.rs:61:29
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | bar::<T::Output>()
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
|
||||||
|
= note: ...so that the type `<T as MyTrait<'_>>::Output` will meet its required lifetime bounds
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | bar::<<T as MyTrait<'a>>::Output>()
|
||||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as MyTrait<'_>>::Output: 'a`...
|
||||||
|
= note: ...so that the type `<T as MyTrait<'_>>::Output` will meet its required lifetime bounds
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/projection-where-clause-none.rs:16:5
|
--> $DIR/projection-where-clause-none.rs:16:5
|
||||||
|
|
|
|
||||||
|
LL | fn foo<'a, T>() -> &'a ()
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | bar::<T::Output>()
|
LL | bar::<T::Output>()
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -52,10 +52,10 @@ LL | | }
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
|
--> $DIR/ty-param-closure-approximate-lower-bound.rs:29:24
|
||||||
|
|
|
|
||||||
|
LL | fn generic_fail<'a, T>(cell: Cell<&'a ()>, value: T) {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
LL | twice(cell, value, |a, b| invoke(a, b));
|
LL | twice(cell, value, |a, b| invoke(a, b));
|
||||||
| ^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -29,18 +29,20 @@ LL | | }
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23
|
--> $DIR/ty-param-closure-outlives-from-return-type.rs:26:23
|
||||||
|
|
|
|
||||||
|
LL | fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | with_signature(x, |y| y)
|
LL | with_signature(x, |y| y)
|
||||||
| ^^^^^
|
| ^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5
|
--> $DIR/ty-param-closure-outlives-from-return-type.rs:41:5
|
||||||
|
|
|
|
||||||
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | x
|
LL | x
|
||||||
| ^
|
| ^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,8 @@ LL | | }
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:27:26
|
||||||
|
|
|
|
||||||
|
LL | fn no_region<'a, T>(a: Cell<&'a ()>, b: T) {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
LL | with_signature(a, b, |x, y| {
|
LL | with_signature(a, b, |x, y| {
|
||||||
| __________________________^
|
| __________________________^
|
||||||
LL | |
|
LL | |
|
||||||
|
@ -45,9 +47,7 @@ LL | | // See `correct_region`, which explains the point of this
|
||||||
... |
|
... |
|
||||||
LL | | require(&x, &y)
|
LL | | require(&x, &y)
|
||||||
LL | | })
|
LL | | })
|
||||||
| |_____^
|
| |_____^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
note: external requirements
|
note: external requirements
|
||||||
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:43:26
|
||||||
|
@ -121,15 +121,16 @@ LL | | }
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:64:26
|
||||||
|
|
|
|
||||||
|
LL | fn wrong_region<'a, 'b, T>(a: Cell<&'a ()>, b: T)
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | with_signature(a, b, |x, y| {
|
LL | with_signature(a, b, |x, y| {
|
||||||
| __________________________^
|
| __________________________^
|
||||||
LL | |
|
LL | |
|
||||||
LL | | // See `correct_region`
|
LL | | // See `correct_region`
|
||||||
LL | | require(&x, &y)
|
LL | | require(&x, &y)
|
||||||
LL | | })
|
LL | | })
|
||||||
| |_____^
|
| |_____^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
note: external requirements
|
note: external requirements
|
||||||
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26
|
--> $DIR/ty-param-closure-outlives-from-where-clause.rs:77:26
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-fn-body.rs:19:5
|
--> $DIR/ty-param-fn-body.rs:19:5
|
||||||
|
|
|
|
||||||
|
LL | fn region_static<'a, T>(cell: Cell<&'a usize>, t: T) {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
LL | outlives(cell, t)
|
LL | outlives(cell, t)
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-fn.rs:11:5
|
--> $DIR/ty-param-fn.rs:11:5
|
||||||
|
|
|
|
||||||
|
LL | fn no_region<'a, T>(x: Box<T>) -> Box<Debug + 'a>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | x
|
LL | x
|
||||||
| ^
|
| ^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/ty-param-fn.rs:26:5
|
--> $DIR/ty-param-fn.rs:26:5
|
||||||
|
|
|
|
||||||
|
LL | fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<Debug + 'a>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | x
|
LL | x
|
||||||
| ^
|
| ^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | Box::new(item)
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
|
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
|
||||||
|
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
error[E0310]: the associated type `<T as Iter>::Item` may not live long enough
|
error[E0310]: the associated type `<T as Iter>::Item` may not live long enough
|
||||||
--> $DIR/regions-close-associated-type-into-object.rs:22:5
|
--> $DIR/regions-close-associated-type-into-object.rs:22:5
|
||||||
|
@ -13,6 +14,7 @@ LL | Box::new(item)
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
|
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'static`...
|
||||||
|
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
|
error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
|
||||||
--> $DIR/regions-close-associated-type-into-object.rs:28:5
|
--> $DIR/regions-close-associated-type-into-object.rs:28:5
|
||||||
|
@ -21,6 +23,7 @@ LL | Box::new(item)
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
|
||||||
|
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
|
error[E0309]: the associated type `<T as Iter>::Item` may not live long enough
|
||||||
--> $DIR/regions-close-associated-type-into-object.rs:35:5
|
--> $DIR/regions-close-associated-type-into-object.rs:35:5
|
||||||
|
@ -29,6 +32,7 @@ LL | Box::new(item)
|
||||||
| ^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
|
= help: consider adding an explicit lifetime bound `<T as Iter>::Item: 'a`...
|
||||||
|
= note: ...so that the type `<T as Iter>::Item` will meet its required lifetime bounds
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
error[E0310]: the parameter type `U` may not live long enough
|
error[E0310]: the parameter type `U` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
||||||
|
|
|
|
||||||
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `U: 'static`
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `U: 'static`...
|
|
||||||
|
|
||||||
error[E0310]: the parameter type `U` may not live long enough
|
error[E0310]: the parameter type `U` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
||||||
|
|
|
|
||||||
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `U: 'static`
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `U: 'static`...
|
|
||||||
|
|
||||||
error[E0310]: the parameter type `U` may not live long enough
|
error[E0310]: the parameter type `U` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
||||||
|
|
|
|
||||||
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `U: 'static`
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^ ...so that the type `U` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `U: 'static`...
|
|
||||||
|
|
||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
--> $DIR/regions-close-object-into-object-4.rs:9:5
|
||||||
|
@ -42,10 +42,10 @@ LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
error[E0310]: the parameter type `U` may not live long enough
|
error[E0310]: the parameter type `U` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-4.rs:9:14
|
--> $DIR/regions-close-object-into-object-4.rs:9:14
|
||||||
|
|
|
|
||||||
|
LL | fn i<'a, T, U>(v: Box<dyn A<U>+'a>) -> Box<dyn X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `U: 'static`
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^
|
| ^^^^^^ ...so that the type `U` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `U: 'static`...
|
|
||||||
|
|
||||||
error: aborting due to 6 previous errors
|
error: aborting due to 6 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,29 @@
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
||||||
|
|
|
|
||||||
|
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
|
LL | // oh dear!
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^^^
|
| ^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
||||||
|
|
|
|
||||||
|
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
|
LL | // oh dear!
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
||||||
|
|
|
|
||||||
|
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
|
LL | // oh dear!
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error[E0515]: cannot return value referencing local data `*v`
|
error[E0515]: cannot return value referencing local data `*v`
|
||||||
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
--> $DIR/regions-close-object-into-object-5.rs:17:5
|
||||||
|
@ -34,10 +37,11 @@ LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-object-into-object-5.rs:17:14
|
--> $DIR/regions-close-object-into-object-5.rs:17:14
|
||||||
|
|
|
|
||||||
|
LL | fn f<'a, T, U>(v: Box<A<T> + 'static>) -> Box<X + 'static> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
|
LL | // oh dear!
|
||||||
LL | Box::new(B(&*v)) as Box<dyn X>
|
LL | Box::new(B(&*v)) as Box<dyn X>
|
||||||
| ^^^^^^
|
| ^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error: aborting due to 5 previous errors
|
error: aborting due to 5 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
error[E0310]: the parameter type `A` may not live long enough
|
error[E0310]: the parameter type `A` may not live long enough
|
||||||
--> $DIR/regions-close-over-type-parameter-1.rs:12:5
|
--> $DIR/regions-close-over-type-parameter-1.rs:12:5
|
||||||
|
|
|
|
||||||
|
LL | fn make_object1<A: SomeTrait>(v: A) -> Box<dyn SomeTrait + 'static> {
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `A: 'static +`
|
||||||
LL | Box::new(v) as Box<dyn SomeTrait + 'static>
|
LL | Box::new(v) as Box<dyn SomeTrait + 'static>
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `A: 'static`...
|
|
||||||
|
|
||||||
error[E0309]: the parameter type `A` may not live long enough
|
error[E0309]: the parameter type `A` may not live long enough
|
||||||
--> $DIR/regions-close-over-type-parameter-1.rs:21:5
|
--> $DIR/regions-close-over-type-parameter-1.rs:21:5
|
||||||
|
|
|
|
||||||
|
LL | fn make_object3<'a, 'b, A: SomeTrait + 'a>(v: A) -> Box<dyn SomeTrait + 'b> {
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `A: 'b +`
|
||||||
LL | Box::new(v) as Box<dyn SomeTrait + 'b>
|
LL | Box::new(v) as Box<dyn SomeTrait + 'b>
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `A: 'b`...
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,38 @@
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-param-into-object.rs:6:5
|
--> $DIR/regions-close-param-into-object.rs:6:5
|
||||||
|
|
|
|
||||||
|
LL | fn p1<T>(v: T) -> Box<dyn X + 'static>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
|
...
|
||||||
LL | Box::new(v)
|
LL | Box::new(v)
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-param-into-object.rs:12:5
|
--> $DIR/regions-close-param-into-object.rs:12:5
|
||||||
|
|
|
|
||||||
|
LL | fn p2<T>(v: Box<T>) -> Box<dyn X + 'static>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
|
...
|
||||||
LL | Box::new(v)
|
LL | Box::new(v)
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'static`...
|
|
||||||
|
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-param-into-object.rs:18:5
|
--> $DIR/regions-close-param-into-object.rs:18:5
|
||||||
|
|
|
|
||||||
|
LL | fn p3<'a,T>(v: T) -> Box<dyn X + 'a>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | Box::new(v)
|
LL | Box::new(v)
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-close-param-into-object.rs:24:5
|
--> $DIR/regions-close-param-into-object.rs:24:5
|
||||||
|
|
|
|
||||||
|
LL | fn p4<'a,T>(v: Box<T>) -> Box<dyn X + 'a>
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'a`
|
||||||
|
...
|
||||||
LL | Box::new(v)
|
LL | Box::new(v)
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to 4 previous errors
|
error: aborting due to 4 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
error[E0309]: the parameter type `T` may not live long enough
|
error[E0309]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/regions-implied-bounds-projection-gap-1.rs:16:5
|
--> $DIR/regions-implied-bounds-projection-gap-1.rs:16:5
|
||||||
|
|
|
|
||||||
|
LL | fn func<'x, T:Trait1<'x>>(t: &'x T::Foo)
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `T: 'x +`
|
||||||
|
LL | {
|
||||||
LL | wf::<&'x T>();
|
LL | wf::<&'x T>();
|
||||||
| ^^^^^^^^^^^
|
| ^^^^^^^^^^^ ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `T: 'x`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ LL | check_bound(x, self)
|
||||||
| ^^^^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider adding an explicit lifetime bound `Self: 'a`...
|
= help: consider adding an explicit lifetime bound `Self: 'a`...
|
||||||
|
= note: ...so that the type `Self` will meet its required lifetime bounds
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
error[E0309]: the parameter type `A` may not live long enough
|
error[E0309]: the parameter type `A` may not live long enough
|
||||||
--> $DIR/regions-infer-bound-from-trait.rs:33:5
|
--> $DIR/regions-infer-bound-from-trait.rs:33:5
|
||||||
|
|
|
|
||||||
|
LL | fn bar1<'a,A>(x: Inv<'a>, a: A) {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `A: 'a`
|
||||||
LL | check_bound(x, a)
|
LL | check_bound(x, a)
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `A: 'a`...
|
|
||||||
|
|
||||||
error[E0309]: the parameter type `A` may not live long enough
|
error[E0309]: the parameter type `A` may not live long enough
|
||||||
--> $DIR/regions-infer-bound-from-trait.rs:37:5
|
--> $DIR/regions-infer-bound-from-trait.rs:37:5
|
||||||
|
|
|
|
||||||
|
LL | fn bar2<'a,'b,A:Is<'b>>(x: Inv<'a>, y: Inv<'b>, a: A) {
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `A: 'a +`
|
||||||
LL | check_bound(x, a)
|
LL | check_bound(x, a)
|
||||||
| ^^^^^^^^^^^^^^^^^
|
| ^^^^^^^^^^^^^^^^^ ...so that the type `A` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `A: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
error[E0311]: the parameter type `T` may not live long enough
|
error[E0311]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/missing-lifetimes-in-signature-2.rs:20:5
|
--> $DIR/missing-lifetimes-in-signature-2.rs:20:5
|
||||||
|
|
|
|
||||||
|
LL | fn func<T: Test>(foo: &Foo, t: T) {
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `T: 'a +`
|
||||||
LL | / foo.bar(move |_| {
|
LL | / foo.bar(move |_| {
|
||||||
LL | |
|
LL | |
|
||||||
LL | | t.test();
|
LL | | t.test();
|
||||||
|
@ -12,6 +14,14 @@ note: the parameter type `T` must be valid for the anonymous lifetime defined he
|
||||||
|
|
|
|
||||||
LL | fn func<T: Test>(foo: &Foo, t: T) {
|
LL | fn func<T: Test>(foo: &Foo, t: T) {
|
||||||
| ^^^
|
| ^^^
|
||||||
|
note: ...so that the type `T` will meet its required lifetime bounds
|
||||||
|
--> $DIR/missing-lifetimes-in-signature-2.rs:20:5
|
||||||
|
|
|
||||||
|
LL | / foo.bar(move |_| {
|
||||||
|
LL | |
|
||||||
|
LL | | t.test();
|
||||||
|
LL | | });
|
||||||
|
| |______^
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@ LL | fn foo<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
||||||
error[E0311]: the parameter type `G` may not live long enough
|
error[E0311]: the parameter type `G` may not live long enough
|
||||||
--> $DIR/missing-lifetimes-in-signature.rs:32:5
|
--> $DIR/missing-lifetimes-in-signature.rs:32:5
|
||||||
|
|
|
|
||||||
|
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `G: 'a`
|
||||||
|
...
|
||||||
LL | / move || {
|
LL | / move || {
|
||||||
LL | | *dest = g.get();
|
LL | | *dest = g.get();
|
||||||
LL | | }
|
LL | | }
|
||||||
|
@ -36,10 +39,20 @@ note: the parameter type `G` must be valid for the anonymous lifetime defined he
|
||||||
|
|
|
|
||||||
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
LL | fn bar<G, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
note: ...so that the type `G` will meet its required lifetime bounds
|
||||||
|
--> $DIR/missing-lifetimes-in-signature.rs:32:5
|
||||||
|
|
|
||||||
|
LL | / move || {
|
||||||
|
LL | | *dest = g.get();
|
||||||
|
LL | | }
|
||||||
|
| |_____^
|
||||||
|
|
||||||
error[E0311]: the parameter type `G` may not live long enough
|
error[E0311]: the parameter type `G` may not live long enough
|
||||||
--> $DIR/missing-lifetimes-in-signature.rs:55:5
|
--> $DIR/missing-lifetimes-in-signature.rs:55:5
|
||||||
|
|
|
|
||||||
|
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `G: 'b +`
|
||||||
|
...
|
||||||
LL | / move || {
|
LL | / move || {
|
||||||
LL | | *dest = g.get();
|
LL | | *dest = g.get();
|
||||||
LL | | }
|
LL | | }
|
||||||
|
@ -50,10 +63,20 @@ note: the parameter type `G` must be valid for the anonymous lifetime defined he
|
||||||
|
|
|
|
||||||
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
LL | fn qux<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
note: ...so that the type `G` will meet its required lifetime bounds
|
||||||
|
--> $DIR/missing-lifetimes-in-signature.rs:55:5
|
||||||
|
|
|
||||||
|
LL | / move || {
|
||||||
|
LL | | *dest = g.get();
|
||||||
|
LL | | }
|
||||||
|
| |_____^
|
||||||
|
|
||||||
error[E0311]: the parameter type `G` may not live long enough
|
error[E0311]: the parameter type `G` may not live long enough
|
||||||
--> $DIR/missing-lifetimes-in-signature.rs:65:9
|
--> $DIR/missing-lifetimes-in-signature.rs:65:9
|
||||||
|
|
|
|
||||||
|
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `G: 'c +`
|
||||||
|
...
|
||||||
LL | / move || {
|
LL | / move || {
|
||||||
LL | | *dest = g.get();
|
LL | | *dest = g.get();
|
||||||
LL | | }
|
LL | | }
|
||||||
|
@ -64,10 +87,20 @@ note: the parameter type `G` must be valid for the anonymous lifetime defined he
|
||||||
|
|
|
|
||||||
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
|
LL | fn qux<'b, G: Get<T> + 'b, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ {
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
note: ...so that the type `G` will meet its required lifetime bounds
|
||||||
|
--> $DIR/missing-lifetimes-in-signature.rs:65:9
|
||||||
|
|
|
||||||
|
LL | / move || {
|
||||||
|
LL | | *dest = g.get();
|
||||||
|
LL | | }
|
||||||
|
| |_________^
|
||||||
|
|
||||||
error[E0311]: the parameter type `G` may not live long enough
|
error[E0311]: the parameter type `G` may not live long enough
|
||||||
--> $DIR/missing-lifetimes-in-signature.rs:77:5
|
--> $DIR/missing-lifetimes-in-signature.rs:77:5
|
||||||
|
|
|
|
||||||
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
|
||||||
|
| -- help: consider adding an explicit lifetime bound...: `G: 'b +`
|
||||||
|
...
|
||||||
LL | / move || {
|
LL | / move || {
|
||||||
LL | | *dest = g.get();
|
LL | | *dest = g.get();
|
||||||
LL | | }
|
LL | | }
|
||||||
|
@ -78,6 +111,13 @@ note: the parameter type `G` must be valid for the anonymous lifetime defined he
|
||||||
|
|
|
|
||||||
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
|
LL | fn bat<'a, G: 'a, T>(g: G, dest: &mut T) -> impl FnOnce() + '_ + 'a
|
||||||
| ^^^^^^
|
| ^^^^^^
|
||||||
|
note: ...so that the type `G` will meet its required lifetime bounds
|
||||||
|
--> $DIR/missing-lifetimes-in-signature.rs:77:5
|
||||||
|
|
|
||||||
|
LL | / move || {
|
||||||
|
LL | | *dest = g.get();
|
||||||
|
LL | | }
|
||||||
|
| |_____^
|
||||||
|
|
||||||
error[E0621]: explicit lifetime required in the type of `dest`
|
error[E0621]: explicit lifetime required in the type of `dest`
|
||||||
--> $DIR/missing-lifetimes-in-signature.rs:77:5
|
--> $DIR/missing-lifetimes-in-signature.rs:77:5
|
||||||
|
@ -93,12 +133,13 @@ LL | | }
|
||||||
error[E0309]: the parameter type `G` may not live long enough
|
error[E0309]: the parameter type `G` may not live long enough
|
||||||
--> $DIR/missing-lifetimes-in-signature.rs:89:5
|
--> $DIR/missing-lifetimes-in-signature.rs:89:5
|
||||||
|
|
|
|
||||||
|
LL | fn bak<'a, G, T>(g: G, dest: &'a mut T) -> impl FnOnce() + 'a
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `G: 'a`
|
||||||
|
...
|
||||||
LL | / move || {
|
LL | / move || {
|
||||||
LL | | *dest = g.get();
|
LL | | *dest = g.get();
|
||||||
LL | | }
|
LL | | }
|
||||||
| |_____^
|
| |_____^ ...so that the type `G` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `G: 'a`...
|
|
||||||
|
|
||||||
error: aborting due to 8 previous errors
|
error: aborting due to 8 previous errors
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
error[E0310]: the parameter type `impl Debug` may not live long enough
|
error[E0310]: the parameter type `impl Debug` may not live long enough
|
||||||
--> $DIR/suggest-impl-trait-lifetime.rs:7:5
|
--> $DIR/suggest-impl-trait-lifetime.rs:7:5
|
||||||
|
|
|
|
||||||
|
LL | fn foo(d: impl Debug) {
|
||||||
|
| ---------- help: consider adding an explicit lifetime bound...: `impl Debug + 'static`
|
||||||
|
LL |
|
||||||
LL | bar(d);
|
LL | bar(d);
|
||||||
| ^^^^^^
|
| ^^^^^^ ...so that the type `impl Debug` will meet its required lifetime bounds
|
||||||
|
|
|
||||||
= help: consider adding an explicit lifetime bound `impl Debug: 'static`...
|
|
||||||
|
|
||||||
error: aborting due to previous error
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
|
|
@ -19,10 +19,10 @@ LL | type WrongGeneric<T> = impl 'static;
|
||||||
error[E0310]: the parameter type `T` may not live long enough
|
error[E0310]: the parameter type `T` may not live long enough
|
||||||
--> $DIR/generic_type_does_not_live_long_enough.rs:18:5
|
--> $DIR/generic_type_does_not_live_long_enough.rs:18:5
|
||||||
|
|
|
|
||||||
|
LL | fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
|
||||||
|
| - help: consider adding an explicit lifetime bound...: `T: 'static`
|
||||||
LL | t
|
LL | t
|
||||||
| ^
|
| ^ ...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
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
|
|
@ -198,11 +198,8 @@ pub struct Config {
|
||||||
/// The rust-demangler executable.
|
/// The rust-demangler executable.
|
||||||
pub rust_demangler_path: Option<PathBuf>,
|
pub rust_demangler_path: Option<PathBuf>,
|
||||||
|
|
||||||
/// The Python executable to use for LLDB.
|
/// The Python executable to use for LLDB and htmldocck.
|
||||||
pub lldb_python: String,
|
pub python: String,
|
||||||
|
|
||||||
/// The Python executable to use for htmldocck.
|
|
||||||
pub docck_python: String,
|
|
||||||
|
|
||||||
/// The jsondocck executable.
|
/// The jsondocck executable.
|
||||||
pub jsondocck_path: Option<String>,
|
pub jsondocck_path: Option<String>,
|
||||||
|
|
|
@ -43,8 +43,7 @@ fn config() -> Config {
|
||||||
"--compile-lib-path=",
|
"--compile-lib-path=",
|
||||||
"--run-lib-path=",
|
"--run-lib-path=",
|
||||||
"--rustc-path=",
|
"--rustc-path=",
|
||||||
"--lldb-python=",
|
"--python=",
|
||||||
"--docck-python=",
|
|
||||||
"--jsondocck-path=",
|
"--jsondocck-path=",
|
||||||
"--src-base=",
|
"--src-base=",
|
||||||
"--build-base=",
|
"--build-base=",
|
||||||
|
|
|
@ -61,8 +61,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
||||||
.reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH")
|
.reqopt("", "rustc-path", "path to rustc to use for compiling", "PATH")
|
||||||
.optopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH")
|
.optopt("", "rustdoc-path", "path to rustdoc to use for compiling", "PATH")
|
||||||
.optopt("", "rust-demangler-path", "path to rust-demangler to use in tests", "PATH")
|
.optopt("", "rust-demangler-path", "path to rust-demangler to use in tests", "PATH")
|
||||||
.reqopt("", "lldb-python", "path to python to use for doc tests", "PATH")
|
.reqopt("", "python", "path to python to use for doc tests", "PATH")
|
||||||
.reqopt("", "docck-python", "path to python to use for doc tests", "PATH")
|
|
||||||
.optopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH")
|
.optopt("", "jsondocck-path", "path to jsondocck to use for doc tests", "PATH")
|
||||||
.optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM")
|
.optopt("", "valgrind-path", "path to Valgrind executable for Valgrind tests", "PROGRAM")
|
||||||
.optflag("", "force-valgrind", "fail if Valgrind tests cannot be run under Valgrind")
|
.optflag("", "force-valgrind", "fail if Valgrind tests cannot be run under Valgrind")
|
||||||
|
@ -222,8 +221,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
||||||
rustc_path: opt_path(matches, "rustc-path"),
|
rustc_path: opt_path(matches, "rustc-path"),
|
||||||
rustdoc_path: matches.opt_str("rustdoc-path").map(PathBuf::from),
|
rustdoc_path: matches.opt_str("rustdoc-path").map(PathBuf::from),
|
||||||
rust_demangler_path: matches.opt_str("rust-demangler-path").map(PathBuf::from),
|
rust_demangler_path: matches.opt_str("rust-demangler-path").map(PathBuf::from),
|
||||||
lldb_python: matches.opt_str("lldb-python").unwrap(),
|
python: matches.opt_str("python").unwrap(),
|
||||||
docck_python: matches.opt_str("docck-python").unwrap(),
|
|
||||||
jsondocck_path: matches.opt_str("jsondocck-path"),
|
jsondocck_path: matches.opt_str("jsondocck-path"),
|
||||||
valgrind_path: matches.opt_str("valgrind-path"),
|
valgrind_path: matches.opt_str("valgrind-path"),
|
||||||
force_valgrind: matches.opt_present("force-valgrind"),
|
force_valgrind: matches.opt_present("force-valgrind"),
|
||||||
|
|
|
@ -179,7 +179,7 @@ pub fn compute_stamp_hash(config: &Config) -> String {
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(Debugger::Lldb) => {
|
Some(Debugger::Lldb) => {
|
||||||
config.lldb_python.hash(&mut hash);
|
config.python.hash(&mut hash);
|
||||||
config.lldb_python_dir.hash(&mut hash);
|
config.lldb_python_dir.hash(&mut hash);
|
||||||
env::var_os("PATH").hash(&mut hash);
|
env::var_os("PATH").hash(&mut hash);
|
||||||
env::var_os("PYTHONPATH").hash(&mut hash);
|
env::var_os("PYTHONPATH").hash(&mut hash);
|
||||||
|
@ -1141,7 +1141,7 @@ impl<'test> TestCx<'test> {
|
||||||
// Prepare the lldb_batchmode which executes the debugger script
|
// Prepare the lldb_batchmode which executes the debugger script
|
||||||
let lldb_script_path = rust_src_root.join("src/etc/lldb_batchmode.py");
|
let lldb_script_path = rust_src_root.join("src/etc/lldb_batchmode.py");
|
||||||
self.cmd2procres(
|
self.cmd2procres(
|
||||||
Command::new(&self.config.lldb_python)
|
Command::new(&self.config.python)
|
||||||
.arg(&lldb_script_path)
|
.arg(&lldb_script_path)
|
||||||
.arg(test_executable)
|
.arg(test_executable)
|
||||||
.arg(debugger_script)
|
.arg(debugger_script)
|
||||||
|
@ -2256,7 +2256,7 @@ impl<'test> TestCx<'test> {
|
||||||
self.check_rustdoc_test_option(proc_res);
|
self.check_rustdoc_test_option(proc_res);
|
||||||
} else {
|
} else {
|
||||||
let root = self.config.find_rust_src_root().unwrap();
|
let root = self.config.find_rust_src_root().unwrap();
|
||||||
let mut cmd = Command::new(&self.config.docck_python);
|
let mut cmd = Command::new(&self.config.python);
|
||||||
cmd.arg(root.join("src/etc/htmldocck.py")).arg(&out_dir).arg(&self.testpaths.file);
|
cmd.arg(root.join("src/etc/htmldocck.py")).arg(&out_dir).arg(&self.testpaths.file);
|
||||||
if self.config.bless {
|
if self.config.bless {
|
||||||
cmd.arg("--bless");
|
cmd.arg("--bless");
|
||||||
|
@ -2457,7 +2457,7 @@ impl<'test> TestCx<'test> {
|
||||||
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
|
let mut json_out = out_dir.join(self.testpaths.file.file_stem().unwrap());
|
||||||
json_out.set_extension("json");
|
json_out.set_extension("json");
|
||||||
let res = self.cmd2procres(
|
let res = self.cmd2procres(
|
||||||
Command::new(&self.config.docck_python)
|
Command::new(&self.config.python)
|
||||||
.arg(root.join("src/etc/check_missing_items.py"))
|
.arg(root.join("src/etc/check_missing_items.py"))
|
||||||
.arg(&json_out),
|
.arg(&json_out),
|
||||||
);
|
);
|
||||||
|
@ -2852,7 +2852,7 @@ impl<'test> TestCx<'test> {
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
.stderr(Stdio::piped())
|
.stderr(Stdio::piped())
|
||||||
.env("TARGET", &self.config.target)
|
.env("TARGET", &self.config.target)
|
||||||
.env("PYTHON", &self.config.docck_python)
|
.env("PYTHON", &self.config.python)
|
||||||
.env("S", src_root)
|
.env("S", src_root)
|
||||||
.env("RUST_BUILD_STAGE", &self.config.stage_id)
|
.env("RUST_BUILD_STAGE", &self.config.stage_id)
|
||||||
.env("RUSTC", cwd.join(&self.config.rustc_path))
|
.env("RUSTC", cwd.join(&self.config.rustc_path))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue