Auto merge of #93173 - matthiaskrgr:rollup-49bj7ta, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #91965 (Add more granular `--exclude` in `x.py`) - #92467 (Ensure that early-bound function lifetimes are always 'local') - #92586 (Set the allocation MIN_ALIGN for espidf to 4.) - #92835 (Improve error message for key="value" cfg arguments.) - #92843 (Improve string concatenation suggestion) - #92963 (Implement tuple array diagnostic) - #93046 (Use let_else in even more places) - #93109 (Improve `Arc` and `Rc` documentation) - #93134 (delete `Stdin::split` forwarder) - #93139 (rustdoc: fix overflow-wrap for table layouts) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This commit is contained in:
commit
ecf72996ed
77 changed files with 644 additions and 510 deletions
|
|
@ -7,7 +7,7 @@ use std::fmt::Debug;
|
|||
use std::fs;
|
||||
use std::hash::Hash;
|
||||
use std::ops::Deref;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::path::{Component, Path, PathBuf};
|
||||
use std::process::Command;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
|
|
@ -105,6 +105,44 @@ struct StepDescription {
|
|||
should_run: fn(ShouldRun<'_>) -> ShouldRun<'_>,
|
||||
make_run: fn(RunConfig<'_>),
|
||||
name: &'static str,
|
||||
kind: Kind,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialOrd, Ord, PartialEq, Eq)]
|
||||
pub struct TaskPath {
|
||||
pub path: PathBuf,
|
||||
pub kind: Option<Kind>,
|
||||
}
|
||||
|
||||
impl TaskPath {
|
||||
pub fn parse(path: impl Into<PathBuf>) -> TaskPath {
|
||||
let mut kind = None;
|
||||
let mut path = path.into();
|
||||
|
||||
let mut components = path.components();
|
||||
if let Some(Component::Normal(os_str)) = components.next() {
|
||||
if let Some(str) = os_str.to_str() {
|
||||
if let Some((found_kind, found_prefix)) = str.split_once("::") {
|
||||
if found_kind.is_empty() {
|
||||
panic!("empty kind in task path {}", path.display());
|
||||
}
|
||||
kind = Some(Kind::parse(found_kind));
|
||||
path = Path::new(found_prefix).join(components.as_path());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TaskPath { path, kind }
|
||||
}
|
||||
}
|
||||
|
||||
impl Debug for TaskPath {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
if let Some(kind) = &self.kind {
|
||||
write!(f, "{}::", kind.as_str())?;
|
||||
}
|
||||
write!(f, "{}", self.path.display())
|
||||
}
|
||||
}
|
||||
|
||||
/// Collection of paths used to match a task rule.
|
||||
|
|
@ -115,14 +153,14 @@ pub enum PathSet {
|
|||
/// These are generally matched as a path suffix. For example, a
|
||||
/// command-line value of `libstd` will match if `src/libstd` is in the
|
||||
/// set.
|
||||
Set(BTreeSet<PathBuf>),
|
||||
Set(BTreeSet<TaskPath>),
|
||||
/// A "suite" of paths.
|
||||
///
|
||||
/// These can match as a path suffix (like `Set`), or as a prefix. For
|
||||
/// example, a command-line value of `src/test/ui/abi/variadic-ffi.rs`
|
||||
/// will match `src/test/ui`. A command-line value of `ui` would also
|
||||
/// match `src/test/ui`.
|
||||
Suite(PathBuf),
|
||||
Suite(TaskPath),
|
||||
}
|
||||
|
||||
impl PathSet {
|
||||
|
|
@ -130,35 +168,46 @@ impl PathSet {
|
|||
PathSet::Set(BTreeSet::new())
|
||||
}
|
||||
|
||||
fn one<P: Into<PathBuf>>(path: P) -> PathSet {
|
||||
fn one<P: Into<PathBuf>>(path: P, kind: Kind) -> PathSet {
|
||||
let mut set = BTreeSet::new();
|
||||
set.insert(path.into());
|
||||
set.insert(TaskPath { path: path.into(), kind: Some(kind.into()) });
|
||||
PathSet::Set(set)
|
||||
}
|
||||
|
||||
fn has(&self, needle: &Path) -> bool {
|
||||
fn has(&self, needle: &Path, module: Option<Kind>) -> bool {
|
||||
let check = |p: &TaskPath| {
|
||||
if let (Some(p_kind), Some(kind)) = (&p.kind, module) {
|
||||
p.path.ends_with(needle) && *p_kind == kind
|
||||
} else {
|
||||
p.path.ends_with(needle)
|
||||
}
|
||||
};
|
||||
|
||||
match self {
|
||||
PathSet::Set(set) => set.iter().any(|p| p.ends_with(needle)),
|
||||
PathSet::Suite(suite) => suite.ends_with(needle),
|
||||
PathSet::Set(set) => set.iter().any(check),
|
||||
PathSet::Suite(suite) => check(suite),
|
||||
}
|
||||
}
|
||||
|
||||
fn path(&self, builder: &Builder<'_>) -> PathBuf {
|
||||
match self {
|
||||
PathSet::Set(set) => set.iter().next().unwrap_or(&builder.build.src).to_path_buf(),
|
||||
PathSet::Suite(path) => PathBuf::from(path),
|
||||
PathSet::Set(set) => {
|
||||
set.iter().next().map(|p| &p.path).unwrap_or(&builder.build.src).clone()
|
||||
}
|
||||
PathSet::Suite(path) => path.path.clone(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StepDescription {
|
||||
fn from<S: Step>() -> StepDescription {
|
||||
fn from<S: Step>(kind: Kind) -> StepDescription {
|
||||
StepDescription {
|
||||
default: S::DEFAULT,
|
||||
only_hosts: S::ONLY_HOSTS,
|
||||
should_run: S::should_run,
|
||||
make_run: S::make_run,
|
||||
name: std::any::type_name::<S>(),
|
||||
kind,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +226,7 @@ impl StepDescription {
|
|||
}
|
||||
|
||||
fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
|
||||
if builder.config.exclude.iter().any(|e| pathset.has(e)) {
|
||||
if builder.config.exclude.iter().any(|e| pathset.has(&e.path, e.kind)) {
|
||||
eprintln!("Skipping {:?} because it is excluded", pathset);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -192,8 +241,10 @@ impl StepDescription {
|
|||
}
|
||||
|
||||
fn run(v: &[StepDescription], builder: &Builder<'_>, paths: &[PathBuf]) {
|
||||
let should_runs =
|
||||
v.iter().map(|desc| (desc.should_run)(ShouldRun::new(builder))).collect::<Vec<_>>();
|
||||
let should_runs = v
|
||||
.iter()
|
||||
.map(|desc| (desc.should_run)(ShouldRun::new(builder, desc.kind)))
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// sanity checks on rules
|
||||
for (desc, should_run) in v.iter().zip(&should_runs) {
|
||||
|
|
@ -226,7 +277,7 @@ impl StepDescription {
|
|||
if let Some(suite) = should_run.is_suite_path(path) {
|
||||
attempted_run = true;
|
||||
desc.maybe_run(builder, suite);
|
||||
} else if let Some(pathset) = should_run.pathset_for_path(path) {
|
||||
} else if let Some(pathset) = should_run.pathset_for_path(path, desc.kind) {
|
||||
attempted_run = true;
|
||||
desc.maybe_run(builder, pathset);
|
||||
}
|
||||
|
|
@ -246,6 +297,8 @@ enum ReallyDefault<'a> {
|
|||
|
||||
pub struct ShouldRun<'a> {
|
||||
pub builder: &'a Builder<'a>,
|
||||
kind: Kind,
|
||||
|
||||
// use a BTreeSet to maintain sort order
|
||||
paths: BTreeSet<PathSet>,
|
||||
|
||||
|
|
@ -255,9 +308,10 @@ pub struct ShouldRun<'a> {
|
|||
}
|
||||
|
||||
impl<'a> ShouldRun<'a> {
|
||||
fn new(builder: &'a Builder<'_>) -> ShouldRun<'a> {
|
||||
fn new(builder: &'a Builder<'_>, kind: Kind) -> ShouldRun<'a> {
|
||||
ShouldRun {
|
||||
builder,
|
||||
kind,
|
||||
paths: BTreeSet::new(),
|
||||
is_really_default: ReallyDefault::Bool(true), // by default no additional conditions
|
||||
}
|
||||
|
|
@ -293,7 +347,7 @@ impl<'a> ShouldRun<'a> {
|
|||
let mut set = BTreeSet::new();
|
||||
for krate in self.builder.in_tree_crates(name, None) {
|
||||
let path = krate.local_path(self.builder);
|
||||
set.insert(path);
|
||||
set.insert(TaskPath { path, kind: Some(self.kind) });
|
||||
}
|
||||
self.paths.insert(PathSet::Set(set));
|
||||
self
|
||||
|
|
@ -306,7 +360,7 @@ impl<'a> ShouldRun<'a> {
|
|||
pub fn krate(mut self, name: &str) -> Self {
|
||||
for krate in self.builder.in_tree_crates(name, None) {
|
||||
let path = krate.local_path(self.builder);
|
||||
self.paths.insert(PathSet::one(path));
|
||||
self.paths.insert(PathSet::one(path, self.kind));
|
||||
}
|
||||
self
|
||||
}
|
||||
|
|
@ -318,19 +372,25 @@ impl<'a> ShouldRun<'a> {
|
|||
|
||||
// multiple aliases for the same job
|
||||
pub fn paths(mut self, paths: &[&str]) -> Self {
|
||||
self.paths.insert(PathSet::Set(paths.iter().map(PathBuf::from).collect()));
|
||||
self.paths.insert(PathSet::Set(
|
||||
paths
|
||||
.iter()
|
||||
.map(|p| TaskPath { path: p.into(), kind: Some(self.kind.into()) })
|
||||
.collect(),
|
||||
));
|
||||
self
|
||||
}
|
||||
|
||||
pub fn is_suite_path(&self, path: &Path) -> Option<&PathSet> {
|
||||
self.paths.iter().find(|pathset| match pathset {
|
||||
PathSet::Suite(p) => path.starts_with(p),
|
||||
PathSet::Suite(p) => path.starts_with(&p.path),
|
||||
PathSet::Set(_) => false,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn suite_path(mut self, suite: &str) -> Self {
|
||||
self.paths.insert(PathSet::Suite(PathBuf::from(suite)));
|
||||
self.paths
|
||||
.insert(PathSet::Suite(TaskPath { path: suite.into(), kind: Some(self.kind.into()) }));
|
||||
self
|
||||
}
|
||||
|
||||
|
|
@ -340,12 +400,12 @@ impl<'a> ShouldRun<'a> {
|
|||
self
|
||||
}
|
||||
|
||||
fn pathset_for_path(&self, path: &Path) -> Option<&PathSet> {
|
||||
self.paths.iter().find(|pathset| pathset.has(path))
|
||||
fn pathset_for_path(&self, path: &Path, kind: Kind) -> Option<&PathSet> {
|
||||
self.paths.iter().find(|pathset| pathset.has(path, Some(kind)))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
|
||||
pub enum Kind {
|
||||
Build,
|
||||
Check,
|
||||
|
|
@ -359,11 +419,44 @@ pub enum Kind {
|
|||
Run,
|
||||
}
|
||||
|
||||
impl Kind {
|
||||
fn parse(string: &str) -> Kind {
|
||||
match string {
|
||||
"build" => Kind::Build,
|
||||
"check" => Kind::Check,
|
||||
"clippy" => Kind::Clippy,
|
||||
"fix" => Kind::Fix,
|
||||
"test" => Kind::Test,
|
||||
"bench" => Kind::Bench,
|
||||
"dist" => Kind::Dist,
|
||||
"doc" => Kind::Doc,
|
||||
"install" => Kind::Install,
|
||||
"run" => Kind::Run,
|
||||
other => panic!("unknown kind: {}", other),
|
||||
}
|
||||
}
|
||||
|
||||
fn as_str(&self) -> &'static str {
|
||||
match self {
|
||||
Kind::Build => "build",
|
||||
Kind::Check => "check",
|
||||
Kind::Clippy => "clippy",
|
||||
Kind::Fix => "fix",
|
||||
Kind::Test => "test",
|
||||
Kind::Bench => "bench",
|
||||
Kind::Dist => "dist",
|
||||
Kind::Doc => "doc",
|
||||
Kind::Install => "install",
|
||||
Kind::Run => "run",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Builder<'a> {
|
||||
fn get_step_descriptions(kind: Kind) -> Vec<StepDescription> {
|
||||
macro_rules! describe {
|
||||
($($rule:ty),+ $(,)?) => {{
|
||||
vec![$(StepDescription::from::<$rule>()),+]
|
||||
vec![$(StepDescription::from::<$rule>(kind)),+]
|
||||
}};
|
||||
}
|
||||
match kind {
|
||||
|
|
@ -540,8 +633,11 @@ impl<'a> Builder<'a> {
|
|||
|
||||
let builder = Self::new_internal(build, kind, vec![]);
|
||||
let builder = &builder;
|
||||
let mut should_run = ShouldRun::new(builder);
|
||||
// The "build" kind here is just a placeholder, it will be replaced with something else in
|
||||
// the following statement.
|
||||
let mut should_run = ShouldRun::new(builder, Kind::Build);
|
||||
for desc in Builder::get_step_descriptions(builder.kind) {
|
||||
should_run.kind = desc.kind;
|
||||
should_run = (desc.should_run)(should_run);
|
||||
}
|
||||
let mut help = String::from("Available paths:\n");
|
||||
|
|
@ -552,11 +648,11 @@ impl<'a> Builder<'a> {
|
|||
match pathset {
|
||||
PathSet::Set(set) => {
|
||||
for path in set {
|
||||
add_path(&path);
|
||||
add_path(&path.path);
|
||||
}
|
||||
}
|
||||
PathSet::Suite(path) => {
|
||||
add_path(&path.join("..."));
|
||||
add_path(&path.path.join("..."));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1626,9 +1722,10 @@ impl<'a> Builder<'a> {
|
|||
pub(crate) fn ensure_if_default<T, S: Step<Output = Option<T>>>(
|
||||
&'a self,
|
||||
step: S,
|
||||
kind: Kind,
|
||||
) -> S::Output {
|
||||
let desc = StepDescription::from::<S>();
|
||||
let should_run = (desc.should_run)(ShouldRun::new(self));
|
||||
let desc = StepDescription::from::<S>(kind);
|
||||
let should_run = (desc.should_run)(ShouldRun::new(self, desc.kind));
|
||||
|
||||
// Avoid running steps contained in --exclude
|
||||
for pathset in &should_run.paths {
|
||||
|
|
@ -1642,13 +1739,16 @@ impl<'a> Builder<'a> {
|
|||
}
|
||||
|
||||
/// Checks if any of the "should_run" paths is in the `Builder` paths.
|
||||
pub(crate) fn was_invoked_explicitly<S: Step>(&'a self) -> bool {
|
||||
let desc = StepDescription::from::<S>();
|
||||
let should_run = (desc.should_run)(ShouldRun::new(self));
|
||||
pub(crate) fn was_invoked_explicitly<S: Step>(&'a self, kind: Kind) -> bool {
|
||||
let desc = StepDescription::from::<S>(kind);
|
||||
let should_run = (desc.should_run)(ShouldRun::new(self, desc.kind));
|
||||
|
||||
for path in &self.paths {
|
||||
if should_run.paths.iter().any(|s| s.has(path))
|
||||
&& !desc.is_excluded(self, &PathSet::Suite(path.clone()))
|
||||
if should_run.paths.iter().any(|s| s.has(path, Some(desc.kind)))
|
||||
&& !desc.is_excluded(
|
||||
self,
|
||||
&PathSet::Suite(TaskPath { path: path.clone(), kind: Some(desc.kind.into()) }),
|
||||
)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ mod dist {
|
|||
let host = TargetSelection::from_user("A");
|
||||
|
||||
builder.run_step_descriptions(
|
||||
&[StepDescription::from::<test::Crate>()],
|
||||
&[StepDescription::from::<test::Crate>(Kind::Test)],
|
||||
&["library/std".into()],
|
||||
);
|
||||
|
||||
|
|
@ -520,7 +520,7 @@ mod dist {
|
|||
#[test]
|
||||
fn test_exclude() {
|
||||
let mut config = configure(&["A"], &["A"]);
|
||||
config.exclude = vec!["src/tools/tidy".into()];
|
||||
config.exclude = vec![TaskPath::parse("src/tools/tidy")];
|
||||
config.cmd = Subcommand::Test {
|
||||
paths: Vec::new(),
|
||||
test_args: Vec::new(),
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ use std::fs;
|
|||
use std::path::{Path, PathBuf};
|
||||
use std::str::FromStr;
|
||||
|
||||
use crate::builder::TaskPath;
|
||||
use crate::cache::{Interned, INTERNER};
|
||||
use crate::channel::GitInfo;
|
||||
pub use crate::flags::Subcommand;
|
||||
|
|
@ -62,7 +63,7 @@ pub struct Config {
|
|||
pub sanitizers: bool,
|
||||
pub profiler: bool,
|
||||
pub ignore_git: bool,
|
||||
pub exclude: Vec<PathBuf>,
|
||||
pub exclude: Vec<TaskPath>,
|
||||
pub include_default_paths: bool,
|
||||
pub rustc_error_format: Option<String>,
|
||||
pub json_output: bool,
|
||||
|
|
@ -635,7 +636,7 @@ impl Config {
|
|||
let flags = Flags::parse(&args);
|
||||
|
||||
let mut config = Config::default_opts();
|
||||
config.exclude = flags.exclude;
|
||||
config.exclude = flags.exclude.into_iter().map(|path| TaskPath::parse(path)).collect();
|
||||
config.include_default_paths = flags.include_default_paths;
|
||||
config.rustc_error_format = flags.rustc_error_format;
|
||||
config.json_output = flags.json_output;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use std::process::Command;
|
|||
|
||||
use build_helper::{output, t};
|
||||
|
||||
use crate::builder::{Builder, RunConfig, ShouldRun, Step};
|
||||
use crate::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
|
||||
use crate::cache::{Interned, INTERNER};
|
||||
use crate::compile;
|
||||
use crate::config::TargetSelection;
|
||||
|
|
@ -1368,7 +1368,7 @@ impl Step for Extended {
|
|||
let mut built_tools = HashSet::new();
|
||||
macro_rules! add_component {
|
||||
($name:expr => $step:expr) => {
|
||||
if let Some(tarball) = builder.ensure_if_default($step) {
|
||||
if let Some(tarball) = builder.ensure_if_default($step, Kind::Dist) {
|
||||
tarballs.push(tarball);
|
||||
built_tools.insert($name);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
|
|||
use crate::Mode;
|
||||
use build_helper::{t, up_to_date};
|
||||
|
||||
use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};
|
||||
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
|
||||
use crate::cache::{Interned, INTERNER};
|
||||
use crate::compile;
|
||||
use crate::config::{Config, TargetSelection};
|
||||
|
|
@ -240,7 +240,7 @@ impl Step for TheBook {
|
|||
invoke_rustdoc(builder, compiler, target, path);
|
||||
}
|
||||
|
||||
if builder.was_invoked_explicitly::<Self>() {
|
||||
if builder.was_invoked_explicitly::<Self>(Kind::Doc) {
|
||||
let out = builder.doc_out(target);
|
||||
let index = out.join("book").join("index.html");
|
||||
open(builder, &index);
|
||||
|
|
@ -400,7 +400,7 @@ impl Step for Standalone {
|
|||
|
||||
// We open doc/index.html as the default if invoked as `x.py doc --open`
|
||||
// with no particular explicit doc requested (e.g. library/core).
|
||||
if builder.paths.is_empty() || builder.was_invoked_explicitly::<Self>() {
|
||||
if builder.paths.is_empty() || builder.was_invoked_explicitly::<Self>(Kind::Doc) {
|
||||
let index = out.join("index.html");
|
||||
open(builder, &index);
|
||||
}
|
||||
|
|
@ -902,7 +902,7 @@ impl Step for RustcBook {
|
|||
name: INTERNER.intern_str("rustc"),
|
||||
src: INTERNER.intern_path(out_base),
|
||||
});
|
||||
if builder.was_invoked_explicitly::<Self>() {
|
||||
if builder.was_invoked_explicitly::<Self>(Kind::Doc) {
|
||||
let out = builder.doc_out(self.target);
|
||||
let index = out.join("rustc").join("index.html");
|
||||
open(builder, &index);
|
||||
|
|
|
|||
|
|
@ -671,7 +671,6 @@ nav.sub {
|
|||
margin: .5em 0;
|
||||
width: calc(100% - 2px);
|
||||
overflow-x: auto;
|
||||
overflow-wrap: normal;
|
||||
display: block;
|
||||
}
|
||||
|
||||
|
|
@ -858,6 +857,31 @@ h2.small-section-header > .anchor {
|
|||
|
||||
.block a.current.crate { font-weight: 500; }
|
||||
|
||||
/* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
|
||||
as much as needed on mobile (see
|
||||
src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
|
||||
this matters). The `anywhere` value means:
|
||||
|
||||
"Soft wrap opportunities introduced by the word break are considered when
|
||||
calculating min-content intrinsic sizes."
|
||||
|
||||
https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap#values
|
||||
|
||||
For table layouts, that becomes a problem: the browser tries to make each
|
||||
column as narrow as possible, and `overflow-wrap: anywhere` means it can do
|
||||
so by breaking words - even if some other column could be shrunk without
|
||||
breaking words! This shows up, for instance, in the `Structs` / `Modules` /
|
||||
`Functions` (etcetera) sections of a module page, and when a docblock
|
||||
contains a table.
|
||||
|
||||
So, for table layouts, override the default with break-word, which does
|
||||
_not_ affect min-content intrinsic sizes.
|
||||
*/
|
||||
table,
|
||||
.item-table {
|
||||
overflow-wrap: break-word;
|
||||
}
|
||||
|
||||
.item-table {
|
||||
display: table;
|
||||
}
|
||||
|
|
@ -2058,10 +2082,6 @@ details.rustdoc-toggle[open] > summary.hideme::after {
|
|||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.docblock table code {
|
||||
overflow-wrap: normal;
|
||||
}
|
||||
|
||||
.sub-container {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
| Free Region Mapping
|
||||
| '_#0r | Global | ['_#2r, '_#1r, '_#0r, '_#4r, '_#3r]
|
||||
| '_#1r | External | ['_#1r, '_#4r]
|
||||
| '_#2r | External | ['_#2r, '_#1r, '_#4r]
|
||||
| '_#1r | Local | ['_#1r, '_#4r]
|
||||
| '_#2r | Local | ['_#2r, '_#1r, '_#4r]
|
||||
| '_#3r | Local | ['_#4r, '_#3r]
|
||||
| '_#4r | Local | ['_#4r]
|
||||
|
|
||||
|
|
|
|||
|
|
@ -39,7 +39,6 @@ impl Trait for Foo {
|
|||
const Y: u32 = 0;
|
||||
}
|
||||
|
||||
|
||||
impl implementors::Whatever for Foo {
|
||||
type Foo = u32;
|
||||
}
|
||||
|
|
@ -58,8 +57,10 @@ pub mod sub_mod {
|
|||
pub mod long_trait {
|
||||
use std::ops::DerefMut;
|
||||
|
||||
pub trait ALongNameBecauseItHelpsTestingTheCurrentProblem: DerefMut<Target = u32>
|
||||
+ From<u128> + Send + Sync + AsRef<str> + 'static {}
|
||||
pub trait ALongNameBecauseItHelpsTestingTheCurrentProblem:
|
||||
DerefMut<Target = u32> + From<u128> + Send + Sync + AsRef<str> + 'static
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
pub mod long_table {
|
||||
|
|
@ -88,18 +89,28 @@ pub mod summary_table {
|
|||
}
|
||||
|
||||
pub mod too_long {
|
||||
pub type ReallyLongTypeNameLongLongLong = Option<unsafe extern "C" fn(a: *const u8, b: *const u8) -> *const u8>;
|
||||
pub type ReallyLongTypeNameLongLongLong =
|
||||
Option<unsafe extern "C" fn(a: *const u8, b: *const u8) -> *const u8>;
|
||||
|
||||
pub const ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong: u32 = 0;
|
||||
pub const ReallyLongTypeNameLongLongLongConstBecauseWhyNotAConstRightGigaGigaSupraLong: u32 = 0;
|
||||
|
||||
pub struct SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName {
|
||||
pub a: u32,
|
||||
}
|
||||
/// This also has a really long doccomment. Lorem ipsum dolor sit amet,
|
||||
/// consectetur adipiscing elit. Suspendisse id nibh malesuada, hendrerit
|
||||
/// massa vel, tincidunt est. Nulla interdum, sem ac efficitur ornare, arcu
|
||||
/// nunc dignissim nibh, at rutrum diam augue ac mauris. Fusce tincidunt et
|
||||
/// ligula sed viverra. Aenean sed facilisis dui, non volutpat felis. In
|
||||
/// vitae est dui. Donec felis nibh, blandit at nibh eu, tempor suscipit
|
||||
/// nisl. Vestibulum ornare porta libero, eu faucibus purus iaculis ut. Ut
|
||||
/// quis tincidunt nunc, in mollis purus. Nulla sed interdum quam. Nunc
|
||||
/// vitae cursus ex.
|
||||
pub struct SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName {
|
||||
pub a: u32,
|
||||
}
|
||||
|
||||
impl SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName {
|
||||
/// ```
|
||||
/// let x = SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName { a: 0 };
|
||||
/// ```
|
||||
impl SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName {
|
||||
/// ```
|
||||
/// let x = SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName { a: 0 };
|
||||
/// ```
|
||||
pub fn foo(&self) {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ assert-property: ("body", {"scrollWidth": "1100"})
|
|||
// However, since there is overflow in the type declaration, its scroll width is bigger.
|
||||
assert-property: (".item-decl pre", {"scrollWidth": "1324"})
|
||||
|
||||
// In the table-ish view on the module index, the name should not be wrapped more than necessary.
|
||||
goto: file://|DOC_PATH|/lib2/too_long/index.html
|
||||
assert-property: (".item-table .struct", {"offsetWidth": "684"})
|
||||
|
||||
// We now make the same check on type declaration...
|
||||
goto: file://|DOC_PATH|/lib2/too_long/type.ReallyLongTypeNameLongLongLong.html
|
||||
assert-property: ("body", {"scrollWidth": "1100"})
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ LL | pub unsafe extern "C" fn no_escape0<'f>(_: usize, ap: ...) -> VaListImpl<'f
|
|||
| |
|
||||
| lifetime `'f` defined here
|
||||
LL | ap
|
||||
| ^^ returning this value requires that `'1` must outlive `'f`
|
||||
| ^^ function was supposed to return data with lifetime `'f` but it is returning data with lifetime `'1`
|
||||
|
|
||||
= note: requirement occurs because of the type VaListImpl<'_>, which makes the generic argument '_ invariant
|
||||
= note: the struct VaListImpl<'f> is invariant over the parameter 'f
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
// compile-flags: --cfg a(b=c)
|
||||
// error-pattern: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`)
|
||||
// error-pattern: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
|
||||
fn main() {}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
error: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`)
|
||||
error: invalid `--cfg` argument: `a(b=c)` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
|
||||
|
||||
|
|
|
|||
4
src/test/ui/conditional-compilation/cfg-arg-invalid-9.rs
Normal file
4
src/test/ui/conditional-compilation/cfg-arg-invalid-9.rs
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
// Test for missing quotes around value, issue #66450.
|
||||
// compile-flags: --cfg key=value
|
||||
// error-pattern: invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
|
||||
fn main() {}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
error: invalid `--cfg` argument: `key=value` (expected `key` or `key="value"`, ensure escaping is appropriate for your shell, try 'key="value"' or key=\"value\")
|
||||
|
||||
|
|
@ -6,7 +6,7 @@ LL | fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | s
|
||||
| ^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,13 @@
|
|||
error[E0521]: borrowed data escapes outside of associated function
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-16683.rs:4:9
|
||||
|
|
||||
LL | trait T<'a> {
|
||||
| -- lifetime `'a` defined here
|
||||
LL | fn a(&'a self) -> &'a bool;
|
||||
LL | fn b(&self) {
|
||||
| -----
|
||||
| |
|
||||
| `self` is a reference that is only valid in the associated function body
|
||||
| let's call the lifetime of this reference `'1`
|
||||
| - let's call the lifetime of this reference `'1`
|
||||
LL | self.a();
|
||||
| ^^^^^^^^
|
||||
| |
|
||||
| `self` escapes the associated function body here
|
||||
| argument requires that `'1` must outlive `'a`
|
||||
| ^^^^^^^^ argument requires that `'1` must outlive `'a`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0521`.
|
||||
|
|
|
|||
|
|
@ -1,20 +1,13 @@
|
|||
error[E0521]: borrowed data escapes outside of associated function
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-17758.rs:7:9
|
||||
|
|
||||
LL | trait Foo<'a> {
|
||||
| -- lifetime `'a` defined here
|
||||
LL | fn foo(&'a self);
|
||||
LL | fn bar(&self) {
|
||||
| -----
|
||||
| |
|
||||
| `self` is a reference that is only valid in the associated function body
|
||||
| let's call the lifetime of this reference `'1`
|
||||
| - let's call the lifetime of this reference `'1`
|
||||
LL | self.foo();
|
||||
| ^^^^^^^^^^
|
||||
| |
|
||||
| `self` escapes the associated function body here
|
||||
| argument requires that `'1` must outlive `'a`
|
||||
| ^^^^^^^^^^ argument requires that `'1` must outlive `'a`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0521`.
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@ LL | let _a = b + ", World!";
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &str
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let _a = b.to_owned() + ", World!";
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@ LL | println!("🦀🦀🦀🦀🦀"); let _a = b + ", World!";
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &str
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | println!("🦀🦀🦀🦀🦀"); let _a = b.to_owned() + ", World!";
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -59,10 +59,8 @@ LL | &(true, false) => ()
|
|||
error[E0618]: expected function, found `(char, char)`
|
||||
--> $DIR/issue-5100.rs:48:14
|
||||
|
|
||||
LL | let v = [('a', 'b')
|
||||
| ______________-^^^^^^^^^
|
||||
LL | | ('c', 'd'),
|
||||
| |_______________________- call expression requires function
|
||||
LL | let v = [('a', 'b')
|
||||
| ^^^^^^^^^^- help: consider separating array elements with a comma: `,`
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-5100.rs:55:19
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn transmute_lifetime<'a, 'b, T>(t: &'a (T,)) -> &'b T {
|
|||
| lifetime `'a` defined here
|
||||
LL | match (&t,) {
|
||||
LL | ((u,),) => u,
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | impl<'b> S<'b> {
|
|||
LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
|
||||
| -- lifetime `'a` defined here
|
||||
LL | match self.0 { ref mut x => x }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
= note: requirement occurs because of a mutable reference to &i32
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
|
|||
| -- lifetime `'a` defined here
|
||||
LL | let ref mut x = self.0;
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
= note: requirement occurs because of a mutable reference to &i32
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> i
|
|||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | fn new(bar: &mut Bar) -> Self {
|
|||
| |
|
||||
| let's call the lifetime of this reference `'1`
|
||||
LL | Foo { bar }
|
||||
| ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2`
|
||||
| ^^^^^^^^^^^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct Consumer<'tcx>(&'tcx ());
|
|||
|
||||
impl<'tcx> Consumer<'tcx> {
|
||||
fn bad_method<'a>(&self, fcx: &FnCtxt<'a, 'tcx>) {
|
||||
let other = self.use_fcx(fcx); //~ ERROR borrowed data
|
||||
let other = self.use_fcx(fcx); //~ ERROR lifetime may not live long enough
|
||||
fcx.use_it(other);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,21 +1,14 @@
|
|||
error[E0521]: borrowed data escapes outside of associated function
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/issue-67007-escaping-data.rs:17:21
|
||||
|
|
||||
LL | impl<'tcx> Consumer<'tcx> {
|
||||
| ---- lifetime `'tcx` defined here
|
||||
LL | fn bad_method<'a>(&self, fcx: &FnCtxt<'a, 'tcx>) {
|
||||
| -- ----- --- `fcx` is a reference that is only valid in the associated function body
|
||||
| | |
|
||||
| | `self` declared here, outside of the associated function body
|
||||
| lifetime `'a` defined here
|
||||
| -- lifetime `'a` defined here
|
||||
LL | let other = self.use_fcx(fcx);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| `fcx` escapes the associated function body here
|
||||
| argument requires that `'a` must outlive `'tcx`
|
||||
| ^^^^^^^^^^^^^^^^^ argument requires that `'a` must outlive `'tcx`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'tcx`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0521`.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn bar<'a, 'b>() -> fn(&'a u32, &'b u32) -> &'a u32 {
|
|||
| lifetime `'a` defined here
|
||||
LL | let g: fn(_, _) -> _ = |_x, y| y;
|
||||
LL | g
|
||||
| ^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usiz
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | (x, y)
|
||||
| ^^^^^^ returning this value requires that `'a` must outlive `'c`
|
||||
| ^^^^^^ function was supposed to return data with lifetime `'c` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'c`
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ LL | fn foo1<'a, 'b, 'c, 'd>(x: &'a usize, y: &'b usize) -> (&'c usize, &'d usiz
|
|||
| |
|
||||
| lifetime `'b` defined here
|
||||
LL | (x, y)
|
||||
| ^^^^^^ returning this value requires that `'b` must outlive `'d`
|
||||
| ^^^^^^ function was supposed to return data with lifetime `'d` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'd`
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ LL | fn foo2<'a, 'b, 'c>(x: &'a usize, y: &'b usize) -> (&'c usize, &'static usi
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | (x, y)
|
||||
| ^^^^^^ returning this value requires that `'a` must outlive `'c`
|
||||
| ^^^^^^ function was supposed to return data with lifetime `'c` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'c`
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ pub struct Foo2<'a> {
|
|||
impl<'a> Foo2<'a> {
|
||||
// should not produce outlives suggestions to name 'self
|
||||
fn get_bar(&self) -> Bar2 {
|
||||
Bar2::new(&self) //~ERROR borrowed data escapes outside of associated function
|
||||
Bar2::new(&self) //~ERROR lifetime may not live long enough
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | fn foo1<'a, 'b>(x: &'a usize) -> &'b usize {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ LL | fn foo4<'a, 'b, 'c>(x: &'a usize) -> (&'b usize, &'c usize) {
|
|||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | (x, x)
|
||||
| ^^^^^^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ LL | impl<'a> Bar<'a> {
|
|||
LL | pub fn get<'b>(&self) -> &'b usize {
|
||||
| -- lifetime `'b` defined here
|
||||
LL | self.x
|
||||
| ^^^^^^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^^^^^^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -85,28 +85,20 @@ LL | impl<'a> Baz<'a> {
|
|||
LL | fn get<'b>(&'b self) -> &'a i32 {
|
||||
| -- lifetime `'b` defined here
|
||||
LL | self.x
|
||||
| ^^^^^^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
error[E0521]: borrowed data escapes outside of associated function
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/outlives-suggestion-simple.rs:73:9
|
||||
|
|
||||
LL | impl<'a> Foo2<'a> {
|
||||
| -- lifetime `'a` defined here
|
||||
LL | // should not produce outlives suggestions to name 'self
|
||||
LL | fn get_bar(&self) -> Bar2 {
|
||||
| -----
|
||||
| |
|
||||
| `self` declared here, outside of the associated function body
|
||||
| `self` is a reference that is only valid in the associated function body
|
||||
| let's call the lifetime of this reference `'1`
|
||||
| - let's call the lifetime of this reference `'1`
|
||||
LL | Bar2::new(&self)
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
| |
|
||||
| `self` escapes the associated function body here
|
||||
| argument requires that `'1` must outlive `'a`
|
||||
| ^^^^^^^^^^^^^^^^ argument requires that `'1` must outlive `'a`
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
For more information about this error, try `rustc --explain E0521`.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | impl<'a> FromBox<'a> for C<'a> {
|
|||
LL | fn from_box(b: Box<B>) -> Self {
|
||||
| - has type `Box<Box<&'1 isize>>`
|
||||
LL | C { f: b }
|
||||
| ^^^^^^^^^^ returning this value requires that `'1` must outlive `'a`
|
||||
| ^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
|
||||
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/type-alias-free-regions.rs:27:9
|
||||
|
|
@ -16,7 +16,7 @@ LL | impl<'a> FromTuple<'a> for C<'a> {
|
|||
LL | fn from_tuple(b: (B,)) -> Self {
|
||||
| - has type `(Box<&'1 isize>,)`
|
||||
LL | C { f: Box::new(b.0) }
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'a`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | fn shared_to_const<'a, 'b>(x: &&'a i32) -> *const &'b i32 {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ LL | fn unique_to_const<'a, 'b>(x: &mut &'a i32) -> *const &'b i32 {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -47,7 +47,7 @@ LL | fn unique_to_mut<'a, 'b>(x: &mut &'a i32) -> *mut &'b i32 {
|
|||
| lifetime `'a` defined here
|
||||
LL | // Two errors because *mut is invariant
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
= note: requirement occurs because of a mutable pointer to &i32
|
||||
|
|
@ -64,7 +64,7 @@ LL | fn mut_to_const<'a, 'b>(x: *mut &'a i32) -> *const &'b i32 {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -77,7 +77,7 @@ LL | fn array_elem<'a, 'b>(x: &'a i32) -> *const &'b i32 {
|
|||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | y
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ LL | fn array_coerce<'a, 'b>(x: &'a i32) -> *const [&'b i32; 3] {
|
|||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | y
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ LL | fn nested_array<'a, 'b>(x: &'a i32) -> *const [&'b i32; 2] {
|
|||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | y
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | pub fn foo<'a, 'b>(u: &'b ()) -> &'a () {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | Foo::xmute(u)
|
||||
| ^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn load3<'a,'b>(ss: &'a dyn SomeTrait) -> &'b dyn SomeTrait {
|
|||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | ss
|
||||
| ^^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | fn borrowed_receiver_different_lifetimes<'a,'b>(x: &'a dyn Foo) -> &'b () {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | x.borrowed()
|
||||
| ^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ LL | fn d<'a,'b>(v: &'a [u8]) -> Box<dyn Foo+'b> {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | Box::new(v)
|
||||
| ^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,18 +1,13 @@
|
|||
error[E0521]: borrowed data escapes outside of function
|
||||
error: lifetime may not live long enough
|
||||
--> $DIR/regions-bounded-method-type-parameters-trait-bound.rs:20:5
|
||||
|
|
||||
LL | fn caller2<'a,'b,F:Foo<'a>>(a: Inv<'a>, b: Inv<'b>, f: F) {
|
||||
| -- -- - - `b` is a reference that is only valid in the function body
|
||||
| | | |
|
||||
| | | `a` declared here, outside of the function body
|
||||
| | lifetime `'b` defined here
|
||||
| -- -- lifetime `'b` defined here
|
||||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | // Here the value provided for 'y is 'b, and hence 'b:'a does not hold.
|
||||
LL | f.method(b);
|
||||
| ^^^^^^^^^^^
|
||||
| |
|
||||
| `b` escapes the function body here
|
||||
| argument requires that `'b` must outlive `'a`
|
||||
| ^^^^^^^^^^^ argument requires that `'b` must outlive `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
= note: requirement occurs because of the type Inv<'_>, which makes the generic argument '_ invariant
|
||||
|
|
@ -21,4 +16,3 @@ LL | f.method(b);
|
|||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0521`.
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | fn a_fn1<'a,'b>(e: TupleStruct<'a>) -> TupleStruct<'b> {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | return e;
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ LL | fn a_fn3<'a,'b>(e: Struct<'a>) -> Struct<'b> {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | return e;
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn make_object_bad<'a,'b,'c,A:SomeTrait+'a+'b>(v: A) -> Box<dyn SomeTrait +
|
|||
| lifetime `'a` defined here
|
||||
LL | // A outlives 'a AND 'b...but not 'c.
|
||||
LL | Box::new(v) as Box<dyn SomeTrait + 'a>
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'c`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'c` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'c`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | fn mk_add_bad2<'a,'b>(x: &'a Ast<'a>, y: &'a Ast<'a>, z: &Ast) -> Ast<'b> {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | Ast::Add(x, y)
|
||||
| ^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ LL | impl<'a> Box<'a> {
|
|||
LL | fn or<'b,G:GetRef<'b>>(&self, g2: G) -> &'a isize {
|
||||
| -- lifetime `'b` defined here
|
||||
LL | g2.get()
|
||||
| ^^^^^^^^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^^^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ LL | / match self.next {
|
|||
LL | | Some(ref next) => next.get(),
|
||||
LL | | None => &self.val
|
||||
LL | | }
|
||||
| |_________^ returning this value requires that `'a` must outlive `'b`
|
||||
| |_________^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ error: lifetime may not live long enough
|
|||
--> $DIR/regions-infer-not-param.rs:15:54
|
||||
|
|
||||
LL | fn take_direct<'a,'b>(p: Direct<'a>) -> Direct<'b> { p }
|
||||
| -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b`
|
||||
| -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
| |
|
||||
| lifetime `'a` defined here
|
||||
|
|
||||
|
|
@ -25,7 +25,7 @@ error: lifetime may not live long enough
|
|||
--> $DIR/regions-infer-not-param.rs:19:63
|
||||
|
|
||||
LL | fn take_indirect2<'a,'b>(p: Indirect2<'a>) -> Indirect2<'b> { p }
|
||||
| -- -- lifetime `'b` defined here ^ returning this value requires that `'a` must outlive `'b`
|
||||
| -- -- lifetime `'b` defined here ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
| |
|
||||
| lifetime `'a` defined here
|
||||
|
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn foo3<'a,'b>(x: &'a mut dyn Dummy) -> &'b mut dyn Dummy {
|
|||
| lifetime `'a` defined here
|
||||
LL | // Without knowing 'a:'b, we can't coerce
|
||||
LL | x
|
||||
| ^ returning this value requires that `'a` must outlive `'b`
|
||||
| ^ function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
|
||||
|
|
||||
= help: consider adding the following bound: `'a: 'b`
|
||||
= note: requirement occurs because of a mutable reference to dyn Dummy
|
||||
|
|
@ -23,7 +23,7 @@ LL | fn foo4<'a:'b,'b>(x: Wrapper<&'a mut dyn Dummy>) -> Wrapper<&'b mut dyn Dum
|
|||
| lifetime `'a` defined here
|
||||
LL | // We can't coerce because it is packed in `Wrapper`
|
||||
LL | x
|
||||
| ^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
= note: requirement occurs because of a mutable reference to dyn Dummy
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@ LL | let x = "Hello " + "World!";
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &str
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let x = "Hello ".to_owned() + "World!";
|
||||
| ~~~~~~~~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error[E0369]: cannot add `World` to `World`
|
||||
--> $DIR/issue-39018.rs:8:26
|
||||
|
|
@ -46,10 +47,10 @@ LL | let x = "Hello " + "World!".to_owned();
|
|||
| | `+` cannot be used to concatenate a `&str` with a `String`
|
||||
| &str
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
help: create an owned `String` on the left and add a borrow on the right
|
||||
|
|
||||
LL | let x = "Hello ".to_owned() + &"World!".to_owned();
|
||||
| ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~
|
||||
| +++++++++++ +
|
||||
|
||||
error[E0369]: cannot add `&String` to `&String`
|
||||
--> $DIR/issue-39018.rs:26:16
|
||||
|
|
@ -60,10 +61,12 @@ LL | let _ = &a + &b;
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &String
|
||||
|
|
||||
help: String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: remove the borrow to obtain an owned `String`
|
||||
|
|
||||
LL | let _ = a + &b;
|
||||
| ~
|
||||
LL - let _ = &a + &b;
|
||||
LL + let _ = a + &b;
|
||||
|
|
||||
|
||||
error[E0369]: cannot add `String` to `&String`
|
||||
--> $DIR/issue-39018.rs:27:16
|
||||
|
|
@ -74,10 +77,11 @@ LL | let _ = &a + b;
|
|||
| | `+` cannot be used to concatenate a `&str` with a `String`
|
||||
| &String
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
help: remove the borrow on the left and add one on the right
|
||||
|
|
||||
LL | let _ = a + &b;
|
||||
| ~ ~~
|
||||
LL - let _ = &a + b;
|
||||
LL + let _ = a + &b;
|
||||
|
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> $DIR/issue-39018.rs:29:17
|
||||
|
|
@ -97,10 +101,10 @@ LL | let _ = e + b;
|
|||
| | `+` cannot be used to concatenate a `&str` with a `String`
|
||||
| &String
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
help: create an owned `String` on the left and add a borrow on the right
|
||||
|
|
||||
LL | let _ = e.to_owned() + &b;
|
||||
| ~~~~~~~~~~~~ ~~
|
||||
| +++++++++++ +
|
||||
|
||||
error[E0369]: cannot add `&String` to `&String`
|
||||
--> $DIR/issue-39018.rs:31:15
|
||||
|
|
@ -111,10 +115,11 @@ LL | let _ = e + &b;
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &String
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let _ = e.to_owned() + &b;
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error[E0369]: cannot add `&str` to `&String`
|
||||
--> $DIR/issue-39018.rs:32:15
|
||||
|
|
@ -125,10 +130,11 @@ LL | let _ = e + d;
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &String
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let _ = e.to_owned() + d;
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error[E0369]: cannot add `&&str` to `&String`
|
||||
--> $DIR/issue-39018.rs:33:15
|
||||
|
|
@ -139,10 +145,11 @@ LL | let _ = e + &d;
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &String
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let _ = e.to_owned() + &d;
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error[E0369]: cannot add `&&str` to `&&str`
|
||||
--> $DIR/issue-39018.rs:34:16
|
||||
|
|
@ -169,10 +176,11 @@ LL | let _ = c + &d;
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &str
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let _ = c.to_owned() + &d;
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error[E0369]: cannot add `&str` to `&str`
|
||||
--> $DIR/issue-39018.rs:37:15
|
||||
|
|
@ -183,10 +191,11 @@ LL | let _ = c + d;
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &str
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let _ = c.to_owned() + d;
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@ LL | let c = a + b;
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &String
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let c = a.to_owned() + b;
|
||||
| ~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,11 @@ LL | ...ཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔ
|
|||
| | `+` cannot be used to concatenate two `&str` strings
|
||||
| &str
|
||||
|
|
||||
help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
|
||||
= note: string concatenation requires an owned `String` on the left
|
||||
help: create an owned `String` from a string reference
|
||||
|
|
||||
LL | let _ = "ༀ༁༂༃༄༅༆༇༈༉༊་༌།༎༏༐༑༒༓༔༕༖༗༘༙༚༛༜༝༞༟༠༡༢༣༤༥༦༧༨༩༪༫༬༭༮༯༰༱༲༳༴༵༶༷༸༹༺༻༼༽༾༿ཀཁགགྷངཅཆཇཉཊཋཌཌྷཎཏཐདདྷནཔཕབབྷམཙཚཛཛྷཝཞཟའཡརལཤཥསཧཨཀྵཪཫཬཱཱཱིིུུྲྀཷླྀཹེཻོཽཾཿ྄ཱྀྀྂྃ྅྆྇ྈྉྊྋྌྍྎྏྐྑྒྒྷྔྕྖྗྙྚྛྜྜྷྞྟྠྡྡྷྣྤྥྦྦྷྨྩྪྫྫྷྭྮྯྰྱྲླྴྵྶྷྸྐྵྺྻྼ྾྿࿀࿁࿂࿃࿄࿅࿆࿇࿈࿉࿊࿋࿌࿎࿏࿐࿑࿒࿓࿔࿕࿖࿗࿘࿙࿚"; let _a = unicode_is_fun.to_owned() + " really fun!";
|
||||
| ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
| +++++++++++
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
|
|
|||
7
src/test/ui/tuple/array-diagnostics.rs
Normal file
7
src/test/ui/tuple/array-diagnostics.rs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fn main() {
|
||||
let _tmp = [
|
||||
("C200B40A82", 3),
|
||||
("C200B40A83", 4) //~ ERROR: expected function, found `(&'static str, {integer})` [E0618]
|
||||
("C200B40A8537", 5),
|
||||
];
|
||||
}
|
||||
9
src/test/ui/tuple/array-diagnostics.stderr
Normal file
9
src/test/ui/tuple/array-diagnostics.stderr
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
error[E0618]: expected function, found `(&'static str, {integer})`
|
||||
--> $DIR/array-diagnostics.rs:4:9
|
||||
|
|
||||
LL | ("C200B40A83", 4)
|
||||
| ^^^^^^^^^^^^^^^^^- help: consider separating array elements with a comma: `,`
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0618`.
|
||||
|
|
@ -7,7 +7,7 @@ LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn get_min_from_max<'min, 'max>(v: Box<dyn Get<&'max i32>>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ LL | fn get_max_from_min<'min, 'max, G>(v: Box<dyn Get<&'min i32>>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'min ()>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | fn foo<'min,'max>(v: SomeStruct<&'max ()>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
= note: requirement occurs because of the type SomeStruct<&()>, which makes the generic argument &() invariant
|
||||
|
|
@ -23,7 +23,7 @@ LL | fn bar<'min,'max>(v: SomeStruct<&'min ()>)
|
|||
| lifetime `'min` defined here
|
||||
...
|
||||
LL | v
|
||||
| ^ returning this value requires that `'min` must outlive `'max`
|
||||
| ^ function was supposed to return data with lifetime `'max` but it is returning data with lifetime `'min`
|
||||
|
|
||||
= help: consider adding the following bound: `'min: 'max`
|
||||
= note: requirement occurs because of the type SomeStruct<&()>, which makes the generic argument &() invariant
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ LL | impl<'a, 'b> Foo<'a, 'b, Evil<'a, 'b>> for () {
|
|||
| lifetime `'a` defined here
|
||||
...
|
||||
LL | u
|
||||
| ^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ LL | impl<'a, 'b> Evil<'a, 'b> {
|
|||
| lifetime `'a` defined here
|
||||
LL | fn inherent_evil(u: &'b u32) -> &'a u32 {
|
||||
LL | u
|
||||
| ^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
@ -45,7 +45,7 @@ LL | fn evil<'a, 'b>(b: &'b u32) -> &'a u32 {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | <()>::static_evil(b)
|
||||
| ^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
@ -57,7 +57,7 @@ LL | fn indirect_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | <IndirectEvil>::static_evil(b)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ LL | fn inherent_evil<'a, 'b>(b: &'b u32) -> &'a u32 {
|
|||
| |
|
||||
| lifetime `'a` defined here
|
||||
LL | <Evil>::inherent_evil(b)
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'b` must outlive `'a`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
|
||||
|
|
||||
= help: consider adding the following bound: `'b: 'a`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue