Auto merge of #86532 - estebank:delete-suggestion-underline, r=petrochenkov

Make deleted code in a suggestion clearer

Show suggestions that include deletions in a way similar to `diff`'s output.

<img width="628" alt="" src="https://user-images.githubusercontent.com/1606434/123350316-9078e580-d50f-11eb-89b9-78431b85e23f.png">

For changes that do not have deletions, use `+` as an underline for additions and `~` as an underline for replacements.

<img width="631" alt="" src="https://user-images.githubusercontent.com/1606434/123701745-1ac68f80-d817-11eb-950b-09e5afd7532f.png">

For multiline suggestions, we now use `~` in the gutter to signal replacements and `+` to signal whole line replacements/additions.

<img width="834" alt="" src="https://user-images.githubusercontent.com/1606434/123701331-8eb46800-d816-11eb-9dcd-ef9098071afb.png">

In all cases we now use color to highlight the specific spans and snippets.
This commit is contained in:
bors 2021-08-11 19:26:01 +00:00
commit ccffcafd55
952 changed files with 5657 additions and 4232 deletions

View file

@ -14,7 +14,10 @@ use rustc_span::{MultiSpan, SourceFile, Span};
use crate::snippet::{Annotation, AnnotationType, Line, MultilineAnnotation, Style, StyledString};
use crate::styled_buffer::StyledBuffer;
use crate::{CodeSuggestion, Diagnostic, DiagnosticId, Level, SubDiagnostic, SuggestionStyle};
use crate::{
CodeSuggestion, Diagnostic, DiagnosticId, Level, SubDiagnostic, SubstitutionHighlight,
SuggestionStyle,
};
use rustc_lint_defs::pluralize;
@ -1590,8 +1593,11 @@ impl EmitterWriter {
);
let mut row_num = 2;
draw_col_separator_no_space(&mut buffer, 1, max_line_num_len + 1);
let mut notice_capitalization = false;
for (complete, parts, only_capitalization) in suggestions.iter().take(MAX_SUGGESTIONS) {
for (complete, parts, highlights, only_capitalization) in
suggestions.iter().take(MAX_SUGGESTIONS)
{
notice_capitalization |= only_capitalization;
// Only show underline if the suggestion spans a single line and doesn't cover the
// entirety of the code output. If you have multiple replacements in the same line
@ -1599,16 +1605,26 @@ impl EmitterWriter {
let show_underline = !(parts.len() == 1 && parts[0].snippet.trim() == complete.trim())
&& complete.lines().count() == 1;
let lines = sm
let has_deletion = parts.iter().any(|p| p.is_deletion());
let is_multiline = complete.lines().count() > 1;
let show_diff = has_deletion && !is_multiline;
if show_diff {
row_num += 1;
}
let file_lines = sm
.span_to_lines(parts[0].span)
.expect("span_to_lines failed when emitting suggestion");
assert!(!lines.lines.is_empty() || parts[0].span.is_dummy());
assert!(!file_lines.lines.is_empty() || parts[0].span.is_dummy());
let line_start = sm.lookup_char_pos(parts[0].span.lo()).line;
draw_col_separator_no_space(&mut buffer, 1, max_line_num_len + 1);
let mut lines = complete.lines();
for (line_pos, line) in lines.by_ref().take(MAX_SUGGESTION_HIGHLIGHT_LINES).enumerate()
for (line_pos, (line, parts)) in
lines.by_ref().zip(highlights).take(MAX_SUGGESTION_HIGHLIGHT_LINES).enumerate()
{
// Print the span column to avoid confusion
buffer.puts(
@ -1617,9 +1633,60 @@ impl EmitterWriter {
&self.maybe_anonymized(line_start + line_pos),
Style::LineNumber,
);
if show_diff {
// Add the line number for both addition and removal to drive the point home.
//
// N - fn foo<A: T>(bar: A) {
// N + fn foo(bar: impl T) {
buffer.puts(
row_num - 1,
0,
&self.maybe_anonymized(line_start + line_pos),
Style::LineNumber,
);
buffer.puts(row_num - 1, max_line_num_len + 1, "- ", Style::Removal);
buffer.puts(
row_num - 1,
max_line_num_len + 3,
&replace_tabs(
&*file_lines
.file
.get_line(file_lines.lines[line_pos].line_index)
.unwrap(),
),
Style::NoStyle,
);
buffer.puts(row_num, max_line_num_len + 1, "+ ", Style::Addition);
} else if is_multiline {
match &parts[..] {
[SubstitutionHighlight { start: 0, end }] if *end == line.len() => {
buffer.puts(row_num, max_line_num_len + 1, "+ ", Style::Addition);
}
[] => {
draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
}
_ => {
buffer.puts(row_num, max_line_num_len + 1, "~ ", Style::Addition);
}
}
} else {
draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
}
// print the suggestion
draw_col_separator(&mut buffer, row_num, max_line_num_len + 1);
buffer.append(row_num, &replace_tabs(line), Style::NoStyle);
if is_multiline {
for SubstitutionHighlight { start, end } in parts {
buffer.set_style_range(
row_num,
max_line_num_len + 3 + start,
max_line_num_len + 3 + end,
Style::Addition,
true,
);
}
}
row_num += 1;
}
@ -1654,25 +1721,36 @@ impl EmitterWriter {
let underline_start = (span_start_pos + start) as isize + offset;
let underline_end = (span_start_pos + start + sub_len) as isize + offset;
assert!(underline_start >= 0 && underline_end >= 0);
let padding: usize = max_line_num_len + 3;
for p in underline_start..underline_end {
buffer.putc(
row_num,
((max_line_num_len + 3) as isize + p) as usize,
'^',
Style::UnderlinePrimary,
// Colorize addition/replacements with green.
buffer.set_style(
row_num - 1,
(padding as isize + p) as usize,
Style::Addition,
true,
);
}
// underline removals too
if underline_start == underline_end {
for p in underline_start - 1..underline_start + 1 {
if !show_diff {
// If this is a replacement, underline with `^`, if this is an addition
// underline with `+`.
buffer.putc(
row_num,
((max_line_num_len + 3) as isize + p) as usize,
'-',
Style::UnderlineSecondary,
(padding as isize + p) as usize,
if part.is_addition(&sm) { '+' } else { '~' },
Style::Addition,
);
}
}
if show_diff {
// Colorize removal with red in diff format.
buffer.set_style_range(
row_num - 2,
(padding as isize + span_start_pos as isize) as usize,
(padding as isize + span_end_pos as isize) as usize,
Style::Removal,
true,
);
}
// length of the code after substitution
let full_sub_len = part
@ -2129,6 +2207,12 @@ impl<'a> WritableDst<'a> {
fn apply_style(&mut self, lvl: Level, style: Style) -> io::Result<()> {
let mut spec = ColorSpec::new();
match style {
Style::Addition => {
spec.set_fg(Some(Color::Green)).set_intense(true);
}
Style::Removal => {
spec.set_fg(Some(Color::Red)).set_intense(true);
}
Style::LineAndColumn => {}
Style::LineNumber => {
spec.set_bold(true);

View file

@ -160,32 +160,77 @@ pub struct SubstitutionPart {
pub snippet: String,
}
/// Used to translate between `Span`s and byte positions within a single output line in highlighted
/// code of structured suggestions.
#[derive(Debug, Clone, Copy)]
pub struct SubstitutionHighlight {
start: usize,
end: usize,
}
impl SubstitutionPart {
pub fn is_addition(&self, sm: &SourceMap) -> bool {
!self.snippet.is_empty()
&& sm
.span_to_snippet(self.span)
.map_or(self.span.is_empty(), |snippet| snippet.trim().is_empty())
}
pub fn is_deletion(&self) -> bool {
self.snippet.trim().is_empty()
}
pub fn is_replacement(&self, sm: &SourceMap) -> bool {
!self.snippet.is_empty()
&& sm
.span_to_snippet(self.span)
.map_or(!self.span.is_empty(), |snippet| !snippet.trim().is_empty())
}
}
impl CodeSuggestion {
/// Returns the assembled code suggestions, whether they should be shown with an underline
/// and whether the substitution only differs in capitalization.
pub fn splice_lines(&self, sm: &SourceMap) -> Vec<(String, Vec<SubstitutionPart>, bool)> {
pub fn splice_lines(
&self,
sm: &SourceMap,
) -> Vec<(String, Vec<SubstitutionPart>, Vec<Vec<SubstitutionHighlight>>, bool)> {
// For the `Vec<Vec<SubstitutionHighlight>>` value, the first level of the vector
// corresponds to the output snippet's lines, while the second level corresponds to the
// substrings within that line that should be highlighted.
use rustc_span::{CharPos, Pos};
/// Append to a buffer the remainder of the line of existing source code, and return the
/// count of lines that have been added for accurate highlighting.
fn push_trailing(
buf: &mut String,
line_opt: Option<&Cow<'_, str>>,
lo: &Loc,
hi_opt: Option<&Loc>,
) {
) -> usize {
let mut line_count = 0;
let (lo, hi_opt) = (lo.col.to_usize(), hi_opt.map(|hi| hi.col.to_usize()));
if let Some(line) = line_opt {
if let Some(lo) = line.char_indices().map(|(i, _)| i).nth(lo) {
let hi_opt = hi_opt.and_then(|hi| line.char_indices().map(|(i, _)| i).nth(hi));
match hi_opt {
Some(hi) if hi > lo => buf.push_str(&line[lo..hi]),
Some(hi) if hi > lo => {
line_count = line[lo..hi].matches('\n').count();
buf.push_str(&line[lo..hi])
}
Some(_) => (),
None => buf.push_str(&line[lo..]),
None => {
line_count = line[lo..].matches('\n').count();
buf.push_str(&line[lo..])
}
}
}
if hi_opt.is_none() {
buf.push('\n');
}
}
line_count
}
assert!(!self.substitutions.is_empty());
@ -220,6 +265,7 @@ impl CodeSuggestion {
return None;
}
let mut highlights = vec![];
// To build up the result, we do this for each span:
// - push the line segment trailing the previous span
// (at the beginning a "phantom" span pointing at the start of the line)
@ -236,17 +282,29 @@ impl CodeSuggestion {
lines.lines.get(0).and_then(|line0| sf.get_line(line0.line_index));
let mut buf = String::new();
let mut line_highlight = vec![];
for part in &substitution.parts {
let cur_lo = sm.lookup_char_pos(part.span.lo());
if prev_hi.line == cur_lo.line {
push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, Some(&cur_lo));
let mut count =
push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, Some(&cur_lo));
while count > 0 {
highlights.push(std::mem::take(&mut line_highlight));
count -= 1;
}
} else {
push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, None);
highlights.push(std::mem::take(&mut line_highlight));
let mut count = push_trailing(&mut buf, prev_line.as_ref(), &prev_hi, None);
while count > 0 {
highlights.push(std::mem::take(&mut line_highlight));
count -= 1;
}
// push lines between the previous and current span (if any)
for idx in prev_hi.line..(cur_lo.line - 1) {
if let Some(line) = sf.get_line(idx) {
buf.push_str(line.as_ref());
buf.push('\n');
highlights.push(std::mem::take(&mut line_highlight));
}
}
if let Some(cur_line) = sf.get_line(cur_lo.line - 1) {
@ -257,10 +315,21 @@ impl CodeSuggestion {
buf.push_str(&cur_line[..end]);
}
}
// Add a whole line highlight per line in the snippet.
line_highlight.push(SubstitutionHighlight {
start: cur_lo.col.0,
end: cur_lo.col.0
+ part.snippet.split('\n').next().unwrap_or(&part.snippet).len(),
});
for line in part.snippet.split('\n').skip(1) {
highlights.push(std::mem::take(&mut line_highlight));
line_highlight.push(SubstitutionHighlight { start: 0, end: line.len() });
}
buf.push_str(&part.snippet);
prev_hi = sm.lookup_char_pos(part.span.hi());
prev_line = sf.get_line(prev_hi.line - 1);
}
highlights.push(std::mem::take(&mut line_highlight));
let only_capitalization = is_case_difference(sm, &buf, bounding_span);
// if the replacement already ends with a newline, don't print the next line
if !buf.ends_with('\n') {
@ -270,7 +339,7 @@ impl CodeSuggestion {
while buf.ends_with('\n') {
buf.pop();
}
Some((buf, substitution.parts, only_capitalization))
Some((buf, substitution.parts, highlights, only_capitalization))
})
.collect()
}

View file

@ -177,4 +177,6 @@ pub enum Style {
NoStyle,
Level(Level),
Highlight,
Addition,
Removal,
}

View file

@ -10,7 +10,7 @@ LL | This(E),
help: insert some indirection (e.g., a `DEF_ID` representable
|
LL | This(Box<E>),
| ^^^^ ^
| ++++ +
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | V(E),
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `f::E` representable
|
LL | V(Box<E>),
| ^^^^ ^
| ++++ +
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | V(E),
help: insert some indirection (e.g., a `Box`, `Rc`, or `&`) to make `E` representable
|
LL | V(Box<E>),
| ^^^^ ^
| ++++ +
error: aborting due to previous error

View file

@ -12,11 +12,11 @@ LL | #![deny(rustdoc::broken_intra_doc_links)]
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@true]
| ^^^^
| ++++
help: to link to the builtin type, prefix with `prim@`
|
LL | /// [prim@true]
| ^^^^^
| +++++
error: `ambiguous` is both a struct and a function
--> $DIR/ambiguity.rs:27:7
@ -27,11 +27,11 @@ LL | /// [`ambiguous`] is ambiguous.
help: to link to the struct, prefix with `struct@`
|
LL | /// [`struct@ambiguous`] is ambiguous.
| ^^^^^^^
| +++++++
help: to link to the function, add parentheses
|
LL | /// [`ambiguous()`] is ambiguous.
| ^^
| ++
error: `ambiguous` is both a struct and a function
--> $DIR/ambiguity.rs:29:6
@ -42,11 +42,11 @@ LL | /// [ambiguous] is ambiguous.
help: to link to the struct, prefix with `struct@`
|
LL | /// [struct@ambiguous] is ambiguous.
| ^^^^^^^
| +++++++
help: to link to the function, add parentheses
|
LL | /// [ambiguous()] is ambiguous.
| ^^
| ++
error: `multi_conflict` is a struct, a function, and a macro
--> $DIR/ambiguity.rs:31:7
@ -57,15 +57,15 @@ LL | /// [`multi_conflict`] is a three-way conflict.
help: to link to the struct, prefix with `struct@`
|
LL | /// [`struct@multi_conflict`] is a three-way conflict.
| ^^^^^^^
| +++++++
help: to link to the function, add parentheses
|
LL | /// [`multi_conflict()`] is a three-way conflict.
| ^^
| ++
help: to link to the macro, add an exclamation mark
|
LL | /// [`multi_conflict!`] is a three-way conflict.
| ^
| +
error: `type_and_value` is both a module and a constant
--> $DIR/ambiguity.rs:33:16
@ -76,11 +76,11 @@ LL | /// Ambiguous [type_and_value].
help: to link to the module, prefix with `mod@`
|
LL | /// Ambiguous [mod@type_and_value].
| ^^^^
| ++++
help: to link to the constant, prefix with `const@`
|
LL | /// Ambiguous [const@type_and_value].
| ^^^^^^
| ++++++
error: `foo::bar` is both an enum and a function
--> $DIR/ambiguity.rs:35:43
@ -91,11 +91,11 @@ LL | /// Ambiguous non-implied shortcut link [`foo::bar`].
help: to link to the enum, prefix with `enum@`
|
LL | /// Ambiguous non-implied shortcut link [`enum@foo::bar`].
| ^^^^^
| +++++
help: to link to the function, add parentheses
|
LL | /// Ambiguous non-implied shortcut link [`foo::bar()`].
| ^^
| ++
error: aborting due to 6 previous errors

View file

@ -12,7 +12,7 @@ LL | #![deny(rustdoc::broken_intra_doc_links)]
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
| ^^^^^
| ~~~~~
error: incompatible link kind for `S`
--> $DIR/disambiguator-mismatch.rs:21:14
@ -23,7 +23,7 @@ LL | /// Link to [mod@S]
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
| ^^^^^
| ~~~~~
error: incompatible link kind for `S`
--> $DIR/disambiguator-mismatch.rs:26:14
@ -34,7 +34,7 @@ LL | /// Link to [union@S]
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
| ^^^^^
| ~~~~~
error: incompatible link kind for `S`
--> $DIR/disambiguator-mismatch.rs:31:14
@ -45,7 +45,7 @@ LL | /// Link to [trait@S]
help: to link to the enum, prefix with `enum@`
|
LL | /// Link to [enum@S]
| ^^^^^
| ~~~~~
error: incompatible link kind for `T`
--> $DIR/disambiguator-mismatch.rs:36:14
@ -56,7 +56,7 @@ LL | /// Link to [struct@T]
help: to link to the trait, prefix with `trait@`
|
LL | /// Link to [trait@T]
| ^^^^^^
| ~~~~~~
error: incompatible link kind for `m`
--> $DIR/disambiguator-mismatch.rs:41:14
@ -66,8 +66,9 @@ LL | /// Link to [derive@m]
|
help: to link to the macro, add an exclamation mark
|
LL | /// Link to [m!]
| --^
LL - /// Link to [derive@m]
LL + /// Link to [m!]
|
error: unresolved link to `m`
--> $DIR/disambiguator-mismatch.rs:46:14
@ -78,7 +79,7 @@ LL | /// Link to [m()]
help: to link to the macro, add an exclamation mark
|
LL | /// Link to [m!()]
| ^
| +
error: incompatible link kind for `s`
--> $DIR/disambiguator-mismatch.rs:52:14
@ -89,7 +90,7 @@ LL | /// Link to [const@s]
help: to link to the static, prefix with `static@`
|
LL | /// Link to [static@s]
| ^^^^^^^
| ~~~~~~~
error: incompatible link kind for `c`
--> $DIR/disambiguator-mismatch.rs:57:14
@ -100,7 +101,7 @@ LL | /// Link to [static@c]
help: to link to the constant, prefix with `const@`
|
LL | /// Link to [const@c]
| ^^^^^^
| ~~~~~~
error: incompatible link kind for `c`
--> $DIR/disambiguator-mismatch.rs:62:14
@ -111,7 +112,7 @@ LL | /// Link to [fn@c]
help: to link to the constant, prefix with `const@`
|
LL | /// Link to [const@c]
| ^^^^^^
| ~~~~~~
error: incompatible link kind for `c`
--> $DIR/disambiguator-mismatch.rs:67:14
@ -121,8 +122,9 @@ LL | /// Link to [c()]
|
help: to link to the constant, prefix with `const@`
|
LL | /// Link to [const@c]
| ^^^^^^--
LL - /// Link to [c()]
LL + /// Link to [const@c]
|
error: incompatible link kind for `f`
--> $DIR/disambiguator-mismatch.rs:72:14
@ -132,8 +134,9 @@ LL | /// Link to [const@f]
|
help: to link to the function, add parentheses
|
LL | /// Link to [f()]
| --^^
LL - /// Link to [const@f]
LL + /// Link to [f()]
|
error: aborting due to 12 previous errors

View file

@ -96,8 +96,9 @@ LL | /// [type@Vec::into_iter]
|
help: to link to the associated function, add parentheses
|
LL | /// [Vec::into_iter()]
| -- ^^
LL - /// [type@Vec::into_iter]
LL + /// [Vec::into_iter()]
|
error: unresolved link to `S`
--> $DIR/errors.rs:68:6
@ -107,8 +108,9 @@ LL | /// [S!]
|
help: to link to the struct, prefix with `struct@`
|
LL | /// [struct@S]
| ^^^^^^^--
LL - /// [S!]
LL + /// [struct@S]
|
error: unresolved link to `S::h`
--> $DIR/errors.rs:78:6
@ -118,8 +120,9 @@ LL | /// [type@S::h]
|
help: to link to the associated function, add parentheses
|
LL | /// [S::h()]
| -- ^^
LL - /// [type@S::h]
LL + /// [S::h()]
|
error: unresolved link to `T::g`
--> $DIR/errors.rs:86:6
@ -129,8 +132,9 @@ LL | /// [type@T::g]
|
help: to link to the associated function, add parentheses
|
LL | /// [T::g()]
| -- ^^
LL - /// [type@T::g]
LL + /// [T::g()]
|
error: unresolved link to `T::h`
--> $DIR/errors.rs:91:6
@ -147,7 +151,7 @@ LL | /// [m()]
help: to link to the macro, add an exclamation mark
|
LL | /// [m!()]
| ^
| +
error: aborting due to 20 previous errors

View file

@ -12,7 +12,7 @@ LL | #![deny(rustdoc::broken_intra_doc_links)]
help: to link to the field, remove the disambiguator
|
LL | /// [`Foo::bar`]
| ^^^^^^^^
| ~~~~~~~~
error: aborting due to previous error

View file

@ -12,7 +12,7 @@ LL | #![deny(rustdoc::broken_intra_doc_links)]
help: to link to the associated constant, prefix with `const@`
|
LL | //! [const@u8::MIN]
| ^^^^^^
| ~~~~~~
error: aborting due to previous error

View file

@ -12,11 +12,11 @@ LL | #![deny(rustdoc::broken_intra_doc_links)]
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
| ^^^^
| ++++
help: to link to the builtin type, prefix with `prim@`
|
LL | /// [prim@char]
| ^^^^^
| +++++
error: `char` is both a module and a builtin type
--> $DIR/prim-conflict.rs:10:6
@ -27,11 +27,11 @@ LL | /// [type@char]
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
| ^^^^
| ~~~~
help: to link to the builtin type, prefix with `prim@`
|
LL | /// [prim@char]
| ^^^^^
| ~~~~~
error: incompatible link kind for `char`
--> $DIR/prim-conflict.rs:19:6
@ -42,7 +42,7 @@ LL | /// [struct@char]
help: to link to the module, prefix with `mod@`
|
LL | /// [mod@char]
| ^^^^
| ~~~~
error: incompatible link kind for `char`
--> $DIR/prim-conflict.rs:26:10
@ -53,7 +53,7 @@ LL | //! [struct@char]
help: to link to the builtin type, prefix with `prim@`
|
LL | //! [prim@char]
| ^^^^^
| ~~~~~
error: aborting due to 4 previous errors

View file

@ -14,7 +14,7 @@ LL | | /// ```
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
| ^^^^^^^
| ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:9:5
@ -32,7 +32,7 @@ LL | | /// ```
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
| ^^^^^^^
| ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:21:5
@ -47,7 +47,7 @@ LL | | /// ```
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
| ^^^^^^^
| ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:35:5
@ -123,7 +123,7 @@ LL | | /// ```
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
| ^^^^^^^
| ~~~~~~~
warning: could not parse code block as Rust code
--> $DIR/invalid-syntax.rs:92:9
@ -148,7 +148,7 @@ LL | | /// ```
help: mark blocks that do not contain Rust code as text
|
LL | /// ```text
| ^^^^^^^
| ~~~~~~~
warning: 12 warnings emitted

View file

@ -9,9 +9,9 @@ LL | | }
|
help: you might have forgotten to add the struct literal inside the block
|
LL | fn foo() { SomeStruct {
LL ~ fn foo() { SomeStruct {
LL | Input: 123
LL | } }
LL ~ } }
|
error: aborting due to previous error

View file

@ -8,15 +8,15 @@ LL | fn foo(i32);
help: if this is a `self` type, give it a parameter name
|
LL | fn foo(self: i32);
| ^^^^^^^^^
| ~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo(i32: TypeName);
| ^^^^^^^^^^^^^
| ~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo(_: i32);
| ^^^^^^
| ~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:9:29
@ -28,15 +28,15 @@ LL | fn foo_with_ref(&mut i32);
help: if this is a `self` type, give it a parameter name
|
LL | fn foo_with_ref(self: &mut i32);
| ^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn foo_with_ref(i32: &mut TypeName);
| ^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn foo_with_ref(_: &mut i32);
| ^^^^^^^^^^^
| ~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:12:47
@ -48,7 +48,7 @@ LL | fn foo_with_qualified_path(<Bar as T>::Baz);
help: explicitly ignore the parameter name
|
LL | fn foo_with_qualified_path(_: <Bar as T>::Baz);
| ^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:15:56
@ -60,7 +60,7 @@ LL | fn foo_with_qualified_path_and_ref(&<Bar as T>::Baz);
help: explicitly ignore the parameter name
|
LL | fn foo_with_qualified_path_and_ref(_: &<Bar as T>::Baz);
| ^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:18:57
@ -72,7 +72,7 @@ LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(_: <Bar as T>::Baz, <Bar as T>::Baz);
| ^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~
error: expected one of `(`, `...`, `..=`, `..`, `::`, `:`, `{`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:18:74
@ -84,7 +84,7 @@ LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, <Bar as T>::Baz);
help: explicitly ignore the parameter name
|
LL | fn foo_with_multiple_qualified_paths(<Bar as T>::Baz, _: <Bar as T>::Baz);
| ^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:22:36
@ -96,15 +96,15 @@ LL | fn bar_with_default_impl(String, String) {}
help: if this is a `self` type, give it a parameter name
|
LL | fn bar_with_default_impl(self: String, String) {}
| ^^^^^^^^^^^^
| ~~~~~~~~~~~~
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String: TypeName, String) {}
| ^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar_with_default_impl(_: String, String) {}
| ^^^^^^^^^
| ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `)`
--> $DIR/anon-params-denied-2018.rs:22:44
@ -116,11 +116,11 @@ LL | fn bar_with_default_impl(String, String) {}
help: if this is a parameter name, give it a type
|
LL | fn bar_with_default_impl(String, String: TypeName) {}
| ^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn bar_with_default_impl(String, _: String) {}
| ^^^^^^^^^
| ~~~~~~~~~
error: expected one of `:`, `@`, or `|`, found `,`
--> $DIR/anon-params-denied-2018.rs:27:22
@ -132,11 +132,11 @@ LL | fn baz(a:usize, b, c: usize) -> usize {
help: if this is a parameter name, give it a type
|
LL | fn baz(a:usize, b: TypeName, c: usize) -> usize {
| ^^^^^^^^^^^
| ~~~~~~~~~~~
help: if this is a type, explicitly ignore the parameter name
|
LL | fn baz(a:usize, _: b, c: usize) -> usize {
| ^^^^
| ~~~~
error: aborting due to 9 previous errors

View file

@ -17,11 +17,11 @@ LL | const ID: i32 = 3;
help: disambiguate the associated constant for candidate #1
|
LL | const X: i32 = Foo::ID;
| ^^^^^
| ~~~~~
help: disambiguate the associated constant for candidate #2
|
LL | const X: i32 = Bar::ID;
| ^^^^^
| ~~~~~
error: aborting due to previous error

View file

@ -13,7 +13,7 @@ LL | pub unsafe auto trait Send {
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Send {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` is not an iterator
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:43
@ -30,7 +30,7 @@ LL | pub trait Iterator {
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Iterator {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: `<<Self as Case1>::C as Iterator>::Item` cannot be shared between threads safely
--> $DIR/bad-bounds-on-assoc-in-trait.rs:27:93
@ -47,7 +47,7 @@ LL | pub unsafe auto trait Sync {
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::C as Iterator>::Item: Sync {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 3 previous errors

View file

@ -13,7 +13,7 @@ LL | pub trait Debug {
help: consider further restricting the associated type
|
LL | trait Case1 where <<Self as Case1>::A as Iterator>::Item: Debug {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<<Self as Foo>::Out as Baz>::Assoc: Default` is not satisfied
--> $DIR/bounds-on-assoc-in-trait.rs:35:38
@ -29,7 +29,7 @@ LL | pub trait Default: Sized {
help: consider further restricting the associated type
|
LL | pub trait Foo where <<Self as Foo>::Out as Baz>::Assoc: Default { type Out: Baz<Assoc: Default>; }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 2 previous errors

View file

@ -64,11 +64,11 @@ LL | enum E1 { V(dyn Iterator<Item: Copy>) }
help: borrowed types always have a statically known size
|
LL | enum E1 { V(&dyn Iterator<Item: Copy>) }
| ^
| +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | enum E1 { V(Box<dyn Iterator<Item: Copy>>) }
| ^^^^ ^
| ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:16:13
@ -82,11 +82,11 @@ LL | enum E3 { V(dyn Iterator<Item: 'static>) }
help: borrowed types always have a statically known size
|
LL | enum E3 { V(&dyn Iterator<Item: 'static>) }
| ^
| +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | enum E3 { V(Box<dyn Iterator<Item: 'static>>) }
| ^^^^ ^
| ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Copy> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:20:15
@ -100,11 +100,11 @@ LL | union U1 { f: dyn Iterator<Item: Copy> }
help: borrowed types always have a statically known size
|
LL | union U1 { f: &dyn Iterator<Item: Copy> }
| ^
| +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | union U1 { f: Box<dyn Iterator<Item: Copy>> }
| ^^^^ ^
| ++++ +
error[E0277]: the size for values of type `(dyn Iterator<Item = impl Sized> + 'static)` cannot be known at compilation time
--> $DIR/inside-adt.rs:25:15
@ -118,11 +118,11 @@ LL | union U3 { f: dyn Iterator<Item: 'static> }
help: borrowed types always have a statically known size
|
LL | union U3 { f: &dyn Iterator<Item: 'static> }
| ^
| +
help: the `Box` type always has a statically known size and allocates its contents in the heap
|
LL | union U3 { f: Box<dyn Iterator<Item: 'static>> }
| ^^^^ ^
| ++++ +
error: aborting due to 13 previous errors

View file

@ -7,8 +7,9 @@ LL | type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
= note: `#[warn(type_alias_bounds)]` on by default
help: the clause will not be checked when the type alias is used, and should be removed
|
LL | type _TaWhere1<T> = T;
| --
LL - type _TaWhere1<T> where T: Iterator<Item: Copy> = T;
LL + type _TaWhere1<T> = T;
|
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:6:25
@ -18,8 +19,9 @@ LL | type _TaWhere2<T> where T: Iterator<Item: 'static> = T;
|
help: the clause will not be checked when the type alias is used, and should be removed
|
LL | type _TaWhere2<T> = T;
| --
LL - type _TaWhere2<T> where T: Iterator<Item: 'static> = T;
LL + type _TaWhere2<T> = T;
|
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:7:25
@ -29,8 +31,9 @@ LL | type _TaWhere3<T> where T: Iterator<Item: 'static> = T;
|
help: the clause will not be checked when the type alias is used, and should be removed
|
LL | type _TaWhere3<T> = T;
| --
LL - type _TaWhere3<T> where T: Iterator<Item: 'static> = T;
LL + type _TaWhere3<T> = T;
|
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:8:25
@ -40,8 +43,9 @@ LL | type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T;
|
help: the clause will not be checked when the type alias is used, and should be removed
|
LL | type _TaWhere4<T> = T;
| --
LL - type _TaWhere4<T> where T: Iterator<Item: 'static + Copy + Send> = T;
LL + type _TaWhere4<T> = T;
|
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:9:25
@ -51,8 +55,9 @@ LL | type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T;
|
help: the clause will not be checked when the type alias is used, and should be removed
|
LL | type _TaWhere5<T> = T;
| --
LL - type _TaWhere5<T> where T: Iterator<Item: for<'a> Into<&'a u8>> = T;
LL + type _TaWhere5<T> = T;
|
warning: where clauses are not enforced in type aliases
--> $DIR/type-alias.rs:10:25
@ -62,8 +67,9 @@ LL | type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T;
|
help: the clause will not be checked when the type alias is used, and should be removed
|
LL | type _TaWhere6<T> = T;
| --
LL - type _TaWhere6<T> where T: Iterator<Item: Iterator<Item: Copy>> = T;
LL + type _TaWhere6<T> = T;
|
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:12:20
@ -73,8 +79,9 @@ LL | type _TaInline1<T: Iterator<Item: Copy>> = T;
|
help: the bound will not be checked when the type alias is used, and should be removed
|
LL | type _TaInline1<T> = T;
| --
LL - type _TaInline1<T: Iterator<Item: Copy>> = T;
LL + type _TaInline1<T> = T;
|
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:13:20
@ -84,8 +91,9 @@ LL | type _TaInline2<T: Iterator<Item: 'static>> = T;
|
help: the bound will not be checked when the type alias is used, and should be removed
|
LL | type _TaInline2<T> = T;
| --
LL - type _TaInline2<T: Iterator<Item: 'static>> = T;
LL + type _TaInline2<T> = T;
|
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:14:20
@ -95,8 +103,9 @@ LL | type _TaInline3<T: Iterator<Item: 'static>> = T;
|
help: the bound will not be checked when the type alias is used, and should be removed
|
LL | type _TaInline3<T> = T;
| --
LL - type _TaInline3<T: Iterator<Item: 'static>> = T;
LL + type _TaInline3<T> = T;
|
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:15:20
@ -106,8 +115,9 @@ LL | type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T;
|
help: the bound will not be checked when the type alias is used, and should be removed
|
LL | type _TaInline4<T> = T;
| --
LL - type _TaInline4<T: Iterator<Item: 'static + Copy + Send>> = T;
LL + type _TaInline4<T> = T;
|
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:16:20
@ -117,8 +127,9 @@ LL | type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T;
|
help: the bound will not be checked when the type alias is used, and should be removed
|
LL | type _TaInline5<T> = T;
| --
LL - type _TaInline5<T: Iterator<Item: for<'a> Into<&'a u8>>> = T;
LL + type _TaInline5<T> = T;
|
warning: bounds on generic parameters are not enforced in type aliases
--> $DIR/type-alias.rs:17:20
@ -128,8 +139,9 @@ LL | type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T;
|
help: the bound will not be checked when the type alias is used, and should be removed
|
LL | type _TaInline6<T> = T;
| --
LL - type _TaInline6<T: Iterator<Item: Iterator<Item: Copy>>> = T;
LL + type _TaInline6<T> = T;
|
warning: 12 warnings emitted

View file

@ -13,11 +13,11 @@ LL | fn a<C:Vehicle+Box>(_: C::Color) {
help: use fully qualified syntax to disambiguate
|
LL | fn a<C:Vehicle+Box>(_: <C as Box>::Color) {
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn a<C:Vehicle+Box>(_: <C as Vehicle>::Color) {
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:20:12
@ -34,11 +34,11 @@ LL | fn b<C>(_: C::Color) where C : Vehicle+Box {
help: use fully qualified syntax to disambiguate
|
LL | fn b<C>(_: <C as Box>::Color) where C : Vehicle+Box {
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn b<C>(_: <C as Vehicle>::Color) where C : Vehicle+Box {
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `C`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:24:12
@ -55,11 +55,11 @@ LL | fn c<C>(_: C::Color) where C : Vehicle, C : Box {
help: use fully qualified syntax to disambiguate
|
LL | fn c<C>(_: <C as Box>::Color) where C : Vehicle, C : Box {
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn c<C>(_: <C as Vehicle>::Color) where C : Vehicle, C : Box {
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:35:20
@ -76,11 +76,11 @@ LL | fn e(&self, _: X::Color) where X : Box;
help: use fully qualified syntax to disambiguate
|
LL | fn e(&self, _: <X as Box>::Color) where X : Box;
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn e(&self, _: <X as Vehicle>::Color) where X : Box;
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:38:20
@ -97,11 +97,11 @@ LL | fn f(&self, _: X::Color) where X : Box { }
help: use fully qualified syntax to disambiguate
|
LL | fn f(&self, _: <X as Box>::Color) where X : Box { }
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn f(&self, _: <X as Vehicle>::Color) where X : Box { }
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
error[E0221]: ambiguous associated type `Color` in bounds of `X`
--> $DIR/associated-type-projection-ambig-between-bound-and-where-clause.rs:30:20
@ -118,11 +118,11 @@ LL | fn d(&self, _: X::Color) where X : Box { }
help: use fully qualified syntax to disambiguate
|
LL | fn d(&self, _: <X as Box>::Color) where X : Box { }
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn d(&self, _: <X as Vehicle>::Color) where X : Box { }
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors

View file

@ -21,11 +21,11 @@ LL | fn dent<C:BoxCar>(c: C, color: C::Color) {
help: use fully qualified syntax to disambiguate
|
LL | fn dent<C:BoxCar>(c: C, color: <C as Vehicle>::Color) {
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn dent<C:BoxCar>(c: C, color: <C as Box>::Color) {
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
error[E0222]: ambiguous associated type `Color` in bounds of `BoxCar`
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:23:37
@ -74,11 +74,11 @@ LL | fn paint<C:BoxCar>(c: C, d: C::Color) {
help: use fully qualified syntax to disambiguate
|
LL | fn paint<C:BoxCar>(c: C, d: <C as Vehicle>::Color) {
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | fn paint<C:BoxCar>(c: C, d: <C as Box>::Color) {
| ^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~
error[E0191]: the value of the associated types `Color` (from trait `Box`), `Color` (from trait `Vehicle`) must be specified
--> $DIR/associated-type-projection-from-multiple-supertraits.rs:32:32

View file

@ -12,7 +12,7 @@ LL | fn to_int(&self) -> isize;
help: consider further restricting the associated type
|
LL | where G : GetToInt, <G as GetToInt>::R: ToInt
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++++++++++
error: aborting due to previous error

View file

@ -9,11 +9,11 @@ LL | let _: A = x.boo();
help: a type parameter with a similar name exists
|
LL | let _: I = x.boo();
| ^
| ~
help: you might be missing a type parameter
|
LL | fn foo2<I: Foo, A>(x: I) {
| ^^^
| +++
error: aborting due to previous error

View file

@ -11,7 +11,7 @@ LL | let _: Bar = x.boo();
help: consider constraining the associated type `<I as Foo>::A` to `Bar`
|
LL | fn foo2<I: Foo<A = Bar>>(x: I) {
| ^^^^^^^^^
| +++++++++
error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
--> $DIR/associated-types-eq-3.rs:38:5

View file

@ -10,7 +10,7 @@ LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
| ^^^^^^^^^^^^^^^
| +++++++++++++++
error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | let u: <T as Foo<usize>>::Bar = t.get_bar();
help: consider further restricting this bound
|
LL | fn f<T:Foo<isize> + Foo<usize>>(t: &T) {
| ^^^^^^^^^^^^
| ++++++++++++
error: aborting due to previous error

View file

@ -12,7 +12,7 @@ LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
help: consider constraining the associated type `<T as Foo>::Y` to `i32`
|
LL | fn have_x_want_y<T:Foo<X=u32, Y = i32>>(t: &T)
| ^^^^^^^^^
| +++++++++
error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
--> $DIR/associated-types-multiple-types-one-trait.rs:18:5
@ -28,7 +28,7 @@ LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
help: consider constraining the associated type `<T as Foo>::X` to `u32`
|
LL | fn have_y_want_x<T:Foo<Y=i32, X = u32>>(t: &T)
| ^^^^^^^^^
| +++++++++
error: aborting due to 2 previous errors

View file

@ -10,7 +10,7 @@ LL | fn uhoh<T>(foo: <T as Get>::Value) {}
help: consider restricting type parameter `T`
|
LL | fn uhoh<T: Get>(foo: <T as Get>::Value) {}
| ^^^^^
| +++++
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
| ^^^^^^^^^^^^^^^
| +++++++++++++++
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) {}
help: consider further restricting `Self`
|
LL | fn uhoh<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get {}
| ^^^^^^^^^^^^^^^
| +++++++++++++++
error[E0277]: the trait bound `(T, U): Get` is not satisfied
--> $DIR/associated-types-no-suitable-supertrait.rs:22:40

View file

@ -19,11 +19,11 @@ LL | pub fn f2<T: Foo + Bar>(a: T, x: T::A) {}
help: use fully qualified syntax to disambiguate
|
LL | pub fn f2<T: Foo + Bar>(a: T, x: <T as Bar>::A) {}
| ^^^^^^^^^^^^^
| ~~~~~~~~~~~~~
help: use fully qualified syntax to disambiguate
|
LL | pub fn f2<T: Foo + Bar>(a: T, x: <T as Foo>::A) {}
| ^^^^^^^^^^^^^
| ~~~~~~~~~~~~~
error: aborting due to 2 previous errors

View file

@ -7,7 +7,7 @@ LL | f1(2i32, 4i32);
help: change the type of the numeric literal from `i32` to `u32`
|
LL | f1(2i32, 4u32);
| ^^^^
| ~~~~
error[E0277]: the trait bound `u32: Foo` is not satisfied
--> $DIR/associated-types-path-2.rs:29:5
@ -50,7 +50,7 @@ LL | let _: i32 = f2(2i32);
help: you can convert a `u32` to an `i32` and panic if the converted value doesn't fit
|
LL | let _: i32 = f2(2i32).try_into().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 6 previous errors

View file

@ -6,8 +6,8 @@ LL | field: I::A
|
help: use a fully qualified path with explicit lifetimes
|
LL | struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
LL | field: <I as Foo<&'a isize>>::A
LL ~ struct SomeStruct<'a, I: for<'x> Foo<&'x isize>> {
LL ~ field: <I as Foo<&'a isize>>::A
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
@ -18,8 +18,8 @@ LL | TupleVariant(I::A),
|
help: use a fully qualified path with explicit lifetimes
|
LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
LL | TupleVariant(<I as Foo<&'c isize>>::A),
LL ~ enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
LL ~ TupleVariant(<I as Foo<&'c isize>>::A),
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
@ -30,10 +30,10 @@ LL | StructVariant { field: I::A },
|
help: use a fully qualified path with explicit lifetimes
|
LL | enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
LL ~ enum SomeEnum<'c, 'b, I: for<'a> Foo<&'a isize>> {
LL | TupleVariant(I::A),
LL |
LL | StructVariant { field: <I as Foo<&'c isize>>::A },
LL ~ StructVariant { field: <I as Foo<&'c isize>>::A },
|
error[E0212]: cannot use the associated type of a trait with uninferred generic parameters
@ -44,9 +44,9 @@ LL | field: I::A,
|
help: use a fully qualified path with explicit lifetimes
|
LL | struct Why<'bb, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
LL ~ struct Why<'bb, 'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i, 'j, 'k, 'n, 'o, 'p, 'q, 'r, 's, 't, 'u, 'v, 'w, 'x,
LL | 'y, 'z, 'aa, I: for<'l, 'm> Foo<&'l &'m isize>> {
LL | field: <I as Foo<&'bb &'bb isize>>::A,
LL ~ field: <I as Foo<&'bb &'bb isize>>::A,
|
error: aborting due to 4 previous errors

View file

@ -10,7 +10,7 @@ LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value);
help: consider further restricting `Self`
|
LL | fn okay<U:Get>(&self, foo: U, bar: <Self as Get>::Value) where Self: Get;
| ^^^^^^^^^^^^^^^
| +++++++++++++++
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | let x = t.get();
help: consider further restricting the associated type
|
LL | fn foo<T:Get>(t: T) where <T as Get>::Value: Sized {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++++++++++++++
error: aborting due to previous error

View file

@ -9,11 +9,11 @@ LL | fn elision<T: Fn() -> &i32>() {
help: consider making the bound lifetime-generic with a new `'a` lifetime
|
LL | fn elision<T: for<'a> Fn() -> &'a i32>() {
| ^^^^^^^ ^^^
| +++++++ ~~~
help: consider using the `'static` lifetime
|
LL | fn elision<T: Fn() -> &'static i32>() {
| ^^^^^^^^
| ~~~~~~~~
error: aborting due to previous error

View file

@ -9,11 +9,11 @@ LL | fn elision(_: fn() -> &i32) {
help: consider making the type lifetime-generic with a new `'a` lifetime
|
LL | fn elision(_: for<'a> fn() -> &'a i32) {
| ^^^^^^^ ^^^
| +++++++ ~~~
help: consider using the `'static` lifetime
|
LL | fn elision(_: fn() -> &'static i32) {
| ^^^^^^^^
| ~~~~~~~~
error: aborting due to previous error

View file

@ -32,7 +32,7 @@ LL | type Bar: Clone = Vec<T>;
help: consider restricting type parameter `T`
|
LL | trait Foo<T: std::clone::Clone> {
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error[E0277]: the trait bound `(): Foo<Self>` is not satisfied
--> $DIR/defaults-suitability.rs:34:5
@ -68,7 +68,7 @@ LL | type Bar: Clone = Vec<Self::Baz>;
help: consider further restricting the associated type
|
LL | trait Foo2<T> where <Self as Foo2<T>>::Baz: Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `<Self as Foo25<T>>::Baz: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:74:5
@ -83,7 +83,7 @@ LL | type Bar: Clone = Vec<Self::Baz>;
help: consider further restricting the associated type
|
LL | trait Foo25<T: Clone> where <Self as Foo25<T>>::Baz: Clone {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++++++++++++++++++++
error[E0277]: the trait bound `T: Clone` is not satisfied
--> $DIR/defaults-suitability.rs:87:5
@ -100,7 +100,7 @@ LL | type Baz = T;
help: consider further restricting type parameter `T`
|
LL | Self::Baz: Clone, T: std::clone::Clone
| ^^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 8 previous errors

View file

@ -11,7 +11,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::fmt::Display {
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-1.rs:20:5
@ -25,7 +25,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:5
@ -39,7 +39,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Deref {
| ^^^^^^^
| +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-1.rs:20:5
@ -53,7 +53,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Copy {
| ^^^^^^
| ++++++
error: aborting due to 4 previous errors

View file

@ -11,7 +11,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + std::fmt::Display {
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error[E0277]: cannot add-assign `&'static str` to `Self`
--> $DIR/defaults-unsound-62211-2.rs:20:5
@ -25,7 +25,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + AddAssign<&'static str> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++++++++
error[E0277]: the trait bound `Self: Deref` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:5
@ -39,7 +39,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Deref {
| ^^^^^^^
| +++++++
error[E0277]: the trait bound `Self: Copy` is not satisfied
--> $DIR/defaults-unsound-62211-2.rs:20:5
@ -53,7 +53,7 @@ LL | type Output: Copy + Deref<Target = str> + AddAssign<&'static str> + Fro
help: consider further restricting `Self`
|
LL | trait UncheckedCopy: Sized + Copy {
| ^^^^^^
| ++++++
error: aborting due to 4 previous errors

View file

@ -28,7 +28,7 @@ LL | impl<S, T> X<'_, T> for (S,) {
help: consider restricting type parameter `T`
|
LL | impl<S, T: for<'b> X<'b, T>> X<'_, T> for (S,) {
| ^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++
error: aborting due to 2 previous errors

View file

@ -23,7 +23,7 @@ LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T {
help: consider further restricting the associated type
|
LL | impl<T: Copy + std::ops::Deref> UnsafeCopy<'_, T> for T where for<'b> <T as UnsafeCopy<'b, T>>::Item: Deref {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++++++++++++++++++++++++++++++++++
error: aborting due to 2 previous errors

View file

@ -12,7 +12,7 @@ LL | fn baz() -> impl Bar<Item = i32> {
help: consider constraining the associated type `<impl Bar as Foo>::Item` to `i32`
|
LL | fn bar() -> impl Bar<Item = i32> {
| ^^^^^^^^^^^^
| ++++++++++++
error: aborting due to previous error

View file

@ -10,11 +10,11 @@ LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
help: consider further restricting `Self`
|
LL | ) -> <Dst as From<Self>>::Result where Dst: From<Self>, Self: Sized {
| ^^^^^^^^^^^^^
| +++++++++++++
help: consider relaxing the implicit `Sized` restriction
|
LL | trait From<Src: ?Sized> {
| ^^^^^^^^
| ++++++++
error: aborting due to previous error

View file

@ -52,7 +52,7 @@ LL | type Test = dyn Add + Sub;
help: specify the associated types
|
LL | type Test = dyn Add<Output = Type> + Sub<Output = Type>;
| ^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors

View file

@ -10,7 +10,7 @@ LL | copy::<dyn Setup<From=T>>(t)
help: consider restricting type parameter `T`
|
LL | pub fn copy_any<T: std::marker::Copy>(t: &T) -> T {
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | type Assoc = T;
help: consider restricting type parameter `T`
|
LL | impl<T: std::marker::Copy> Complete for T {
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error: aborting due to previous error

View file

@ -11,7 +11,7 @@ LL | type Size = <Self as SubEncoder>::ActualSize;
help: consider further restricting the associated type
|
LL | T: SubEncoder, <T as SubEncoder>::ActualSize: Add
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | type This = Self;
help: consider further restricting `Self`
|
LL | trait MyTrait: Sized {
| ^^^^^^^
| +++++++
error: aborting due to previous error

View file

@ -12,7 +12,7 @@ LL | accepts_trait(a);
help: consider constraining the associated type `<A as Trait>::Associated` to `()`
|
LL | A: Trait<Associated = ()> + 'static,
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<B as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:59:5
@ -42,7 +42,7 @@ LL | accepts_trait(c);
help: consider constraining the associated type `<C as Trait>::Associated` to `()`
|
LL | C: Trait<Associated = ()> + Foo,
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<D as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:65:5
@ -72,7 +72,7 @@ LL | accepts_generic_trait(e);
help: consider constraining the associated type `<E as GenericTrait<()>>::Associated` to `()`
|
LL | E: GenericTrait<(), Associated = ()> + 'static,
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<F as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:71:5
@ -88,7 +88,7 @@ LL | accepts_generic_trait(f);
help: consider constraining the associated type `<F as GenericTrait<()>>::Associated` to `()`
|
LL | F: GenericTrait<(), Associated = ()> + Foo,
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<G as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:74:5
@ -121,7 +121,7 @@ LL | accepts_trait(returns_opaque());
help: consider constraining the associated type `<impl Trait as Trait>::Associated` to `()`
|
LL | fn returns_opaque() -> impl Trait<Associated = ()> + 'static {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl DerivedTrait as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:82:5
@ -140,7 +140,7 @@ LL | accepts_trait(returns_opaque_derived());
help: consider constraining the associated type `<impl DerivedTrait as Trait>::Associated` to `()`
|
LL | fn returns_opaque_derived() -> impl DerivedTrait<Associated = ()> + 'static {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl Trait+Foo as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:85:5
@ -159,7 +159,7 @@ LL | accepts_trait(returns_opaque_foo());
help: consider constraining the associated type `<impl Trait+Foo as Trait>::Associated` to `()`
|
LL | fn returns_opaque_foo() -> impl Trait<Associated = ()> + Foo {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl DerivedTrait+Foo as Trait>::Associated == ()`
--> $DIR/issue-87261.rs:88:5
@ -195,7 +195,7 @@ LL | accepts_generic_trait(returns_opaque_generic());
help: consider constraining the associated type `<impl GenericTrait<()> as GenericTrait<()>>::Associated` to `()`
|
LL | fn returns_opaque_generic() -> impl GenericTrait<(), Associated = ()> + 'static {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:94:5
@ -214,7 +214,7 @@ LL | accepts_generic_trait(returns_opaque_generic_foo());
help: consider constraining the associated type `<impl GenericTrait<()>+Foo as GenericTrait<()>>::Associated` to `()`
|
LL | fn returns_opaque_generic_foo() -> impl GenericTrait<(), Associated = ()> + Foo {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0271]: type mismatch resolving `<impl GenericTrait<()>+GenericTrait<u8> as GenericTrait<()>>::Associated == ()`
--> $DIR/issue-87261.rs:97:5

View file

@ -25,7 +25,7 @@ LL | type Foo<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Y<Rhs>;
help: specify the associated types
|
LL | type Foo<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs, Output = Type> + Y<Rhs, A = Type>;
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:15:32
@ -61,7 +61,7 @@ LL | type Bar<Rhs> = dyn Add<Rhs> + Sub<Rhs> + X<Rhs> + Z<Rhs>;
help: specify the associated types
|
LL | type Bar<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + X<Rhs> + Z<Rhs, A = Type, B = Type, Output = Type>;
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:18:32
@ -89,7 +89,7 @@ LL | type Baz<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Y<Rhs>;
help: specify the associated types
|
LL | type Baz<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Y<Rhs, A = Type>;
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
error[E0225]: only auto traits can be used as additional traits in a trait object
--> $DIR/missing-associated-types.rs:21:32
@ -113,7 +113,7 @@ LL | type Bat<Rhs> = dyn Add<Rhs> + Sub<Rhs> + Fine<Rhs>;
help: specify the associated types
|
LL | type Bat<Rhs> = dyn Add<Rhs, Output = Type> + Sub<Rhs, Output = Type> + Fine<Rhs>;
| ^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~
error[E0191]: the value of the associated types `Output` (from trait `Div`), `Output` (from trait `Mul`) must be specified
--> $DIR/missing-associated-types.rs:24:21

View file

@ -12,7 +12,7 @@ LL | pub trait Add<Rhs = Self> {
help: consider further restricting `Self`
|
LL | trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> + Sized {}
| ^^^^^^^
| +++++++
error: aborting due to previous error

View file

@ -15,7 +15,7 @@ LL | fn test_boxed() -> Box<impl std::future::Future<Output = u32>> {
help: to force the async block to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | Box::new(async move { x } )
| ^^^^
| ++++
error[E0373]: async block may outlive the current function, but it borrows `x`, which is owned by the current function
--> $DIR/async-borrowck-escaping-block-error.rs:11:11
@ -34,7 +34,7 @@ LL | async { *x }
help: to force the async block to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | async move { *x }
| ^^^^
| ++++
error: aborting due to 2 previous errors

View file

@ -14,7 +14,7 @@ LL | Box::new((async || x)())
help: to force the closure to take ownership of `x` (and any other referenced variables), use the `move` keyword
|
LL | Box::new((async move || x)())
| ^^^^
| ++++
error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | pub mod await {
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:7:20
@ -18,7 +18,7 @@ LL | pub struct await;
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:22
@ -29,7 +29,7 @@ LL | use self::outer_mod::await::await;
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:10:29
@ -40,7 +40,7 @@ LL | use self::outer_mod::await::await;
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:13:14
@ -51,7 +51,7 @@ LL | struct Foo { await: () }
help: you can escape reserved keywords to use them as identifiers
|
LL | struct Foo { r#await: () }
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:16:15
@ -62,7 +62,7 @@ LL | impl Foo { fn await() {} }
help: you can escape reserved keywords to use them as identifiers
|
LL | impl Foo { fn r#await() {} }
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error-in-non-macro-position.rs:19:14
@ -73,7 +73,7 @@ LL | macro_rules! await {
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await {
| ^^^^^^^
| ~~~~~~~
error: aborting due to 7 previous errors

View file

@ -7,7 +7,7 @@ LL | pub mod await {
help: you can escape reserved keywords to use them as identifiers
|
LL | pub mod r#await {
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:6:20
@ -18,7 +18,7 @@ LL | pub struct await;
help: you can escape reserved keywords to use them as identifiers
|
LL | pub struct r#await;
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:22
@ -29,7 +29,7 @@ LL | use self::outer_mod::await::await;
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::r#await::await;
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:9:29
@ -40,7 +40,7 @@ LL | use self::outer_mod::await::await;
help: you can escape reserved keywords to use them as identifiers
|
LL | use self::outer_mod::await::r#await;
| ^^^^^^^
| ~~~~~~~
error: expected identifier, found keyword `await`
--> $DIR/2018-edition-error.rs:12:14
@ -51,7 +51,7 @@ LL | macro_rules! await { () => {}; }
help: you can escape reserved keywords to use them as identifiers
|
LL | macro_rules! r#await { () => {}; }
| ^^^^^^^
| ~~~~~~~
error: expected expression, found `)`
--> $DIR/2018-edition-error.rs:15:12

View file

@ -14,7 +14,7 @@ LL | async fn make_u32() -> u32 {
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
| ^^^^^^
| ++++++
error: aborting due to previous error

View file

@ -13,7 +13,7 @@ LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
help: consider `await`ing on the `Future`
|
LL | foo().await?;
| ^^^^^^
| ++++++
error[E0277]: the `?` operator can only be applied to values that implement `Try`
--> $DIR/issue-61076.rs:67:5
@ -30,7 +30,7 @@ LL | fn branch(self) -> ControlFlow<Self::Residual, Self::Output>;
help: consider `await`ing on the `Future`
|
LL | t.await?;
| ^^^^^^
| ++++++
error[E0609]: no field `0` on type `impl Future`
--> $DIR/issue-61076.rs:78:26
@ -41,7 +41,7 @@ LL | let _: i32 = tuple().0;
help: consider `await`ing on the `Future` and access the field of its `Output`
|
LL | let _: i32 = tuple().await.0;
| ^^^^^^
| ++++++
error[E0609]: no field `a` on type `impl Future`
--> $DIR/issue-61076.rs:82:28
@ -52,7 +52,7 @@ LL | let _: i32 = struct_().a;
help: consider `await`ing on the `Future` and access the field of its `Output`
|
LL | let _: i32 = struct_().await.a;
| ^^^^^^
| ++++++
error[E0599]: no method named `method` found for opaque type `impl Future` in the current scope
--> $DIR/issue-61076.rs:86:15
@ -63,7 +63,7 @@ LL | struct_().method();
help: consider `await`ing on the `Future` and calling the method on its `Output`
|
LL | struct_().await.method();
| ^^^^^^
| ++++++
error[E0308]: mismatched types
--> $DIR/issue-61076.rs:94:9
@ -81,7 +81,7 @@ LL | async fn tuple() -> Tuple {
help: consider `await`ing on the `Future`
|
LL | match tuple().await {
| ^^^^^^
| ++++++
error: aborting due to 6 previous errors

View file

@ -12,7 +12,7 @@ LL | async { (ty, ty1) }
help: consider restricting type parameter `U`
|
LL | fn foo<T: Send, U: std::marker::Send>(ty: T, ty1: U) -> impl Future<Output = (T, U)> + Send {
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error: aborting due to previous error

View file

@ -26,7 +26,7 @@ LL | struct Foo {
help: function arguments must have a statically known size, borrowed types always have a known size
|
LL | async fn frob(&self) {}
| ^
| +
error: aborting due to 3 previous errors

View file

@ -17,7 +17,7 @@ LL | let x = x;
help: consider further restricting type parameter `T`
|
LL | where 'me:'async_trait, T: std::marker::Sync {
| ^^^^^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++++++
error: aborting due to previous error

View file

@ -14,7 +14,7 @@ LL | foo(|| self.bar()).await;
help: to force the closure to take ownership of `self` (and any other referenced variables), use the `move` keyword
|
LL | foo(move || self.bar()).await;
| ^^^^
| ++++
error[E0521]: borrowed data escapes outside of associated function
--> $DIR/issue-62097.rs:13:9

View file

@ -10,7 +10,7 @@ LL | ) -> &dyn Foo
help: consider using the `'a` lifetime
|
LL | ) -> &'a dyn Foo
| ^^^
| ~~~
error: aborting due to previous error

View file

@ -14,7 +14,7 @@ LL | pub enum Result<T, E> {
help: add missing generic argument
|
LL | async fn copy() -> Result<(), E>
| ^^^
| +++
error[E0282]: type annotations needed
--> $DIR/issue-65159.rs:8:5

View file

@ -12,7 +12,7 @@ LL | | });
help: to force the async block to take ownership of `room_ref` (and any other referenced variables), use the `move` keyword
|
LL | let gameloop_handle = spawn(async move {
| ^^^^
| ++++
error: aborting due to previous error

View file

@ -15,7 +15,7 @@ LL | fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Outpu
help: consider wrapping the receiver expression with the appropriate type
|
LL | Pin::new(&mut self.sleep).poll(cx)
| ^^^^^^^^^^^^^ ^
| +++++++++++++ +
error: aborting due to previous error

View file

@ -14,7 +14,7 @@ LL | async fn make_u32() -> u32 {
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
| ^^^^^^
| ++++++
error: aborting due to previous error

View file

@ -14,7 +14,7 @@ LL | async fn make_u32() -> u32 {
help: consider `await`ing on the `Future`
|
LL | take_u32(x.await)
| ^^^^^^
| ++++++
error[E0308]: mismatched types
--> $DIR/suggest-missing-await.rs:22:5
@ -32,11 +32,11 @@ LL | async fn dummy() {}
help: consider `await`ing on the `Future`
|
LL | dummy().await
| ^^^^^^
| ++++++
help: consider using a semicolon here
|
LL | dummy();
| ^
| +
error: aborting due to 2 previous errors

View file

@ -7,7 +7,7 @@ LL | #[rustc_dummy = b"ffi.rs"]
help: if you meant to use the UTF-8 encoding of 'ffi', use \xHH escapes
|
LL | #[rustc_dummy = b"/xEF/xAC/x83.rs"]
| ^^^^^^^^^^^^
| ~~~~~~~~~~~~
error: aborting due to previous error

View file

@ -9,7 +9,7 @@ LL | x % 2 == 0
help: `%` can be used on `{integer}`, you can dereference `x`
|
LL | *x % 2 == 0
| ^
| +
error: aborting due to previous error

View file

@ -16,7 +16,7 @@ LL | fn add(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn add<A: Add<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:8:10
@ -32,7 +32,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn add<A: Add<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:13:10
@ -52,7 +52,7 @@ LL | fn sub(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn sub<A: Sub<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:14:10
@ -68,7 +68,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn sub<A: Sub<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:19:10
@ -88,7 +88,7 @@ LL | fn mul(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn mul<A: Mul<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:20:10
@ -104,7 +104,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn mul<A: Mul<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:25:10
@ -124,7 +124,7 @@ LL | fn div(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn div<A: Div<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:26:10
@ -140,7 +140,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn div<A: Div<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:31:10
@ -160,7 +160,7 @@ LL | fn rem(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn rem<A: Rem<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:32:10
@ -176,7 +176,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn rem<A: Rem<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:37:10
@ -196,7 +196,7 @@ LL | fn bitand(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn bitand<A: BitAnd<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:38:10
@ -212,7 +212,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn bitand<A: BitAnd<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:43:10
@ -232,7 +232,7 @@ LL | fn bitor(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn bitor<A: BitOr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:44:10
@ -248,7 +248,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn bitor<A: BitOr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:49:10
@ -268,7 +268,7 @@ LL | fn bitxor(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn bitxor<A: BitXor<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:50:10
@ -284,7 +284,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn bitxor<A: BitXor<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:55:10
@ -304,7 +304,7 @@ LL | fn shl(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn shl<A: Shl<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:56:10
@ -320,7 +320,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn shl<A: Shl<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `lhs`
--> $DIR/binop-consume-args.rs:61:10
@ -340,7 +340,7 @@ LL | fn shr(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn shr<A: Shr<B, Output=()> + Copy, B>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error[E0382]: use of moved value: `rhs`
--> $DIR/binop-consume-args.rs:62:10
@ -356,7 +356,7 @@ LL | drop(rhs);
help: consider restricting type parameter `B`
|
LL | fn shr<A: Shr<B, Output=()>, B: Copy>(lhs: A, rhs: B) {
| ^^^^^^
| ++++++
error: aborting due to 20 previous errors

View file

@ -19,7 +19,7 @@ LL | fn add(self, rhs: Rhs) -> Self::Output;
help: consider further restricting this bound
|
LL | fn double_move<T: Add<Output=()> + Copy>(x: T) {
| ^^^^^^
| ++++++
error[E0382]: borrow of moved value: `x`
--> $DIR/binop-move-semantics.rs:14:5
@ -35,7 +35,7 @@ LL | x.clone();
help: consider further restricting this bound
|
LL | fn move_then_borrow<T: Add<Output=()> + Clone + Copy>(x: T) {
| ^^^^^^
| ++++++
error[E0505]: cannot move out of `x` because it is borrowed
--> $DIR/binop-move-semantics.rs:21:5

View file

@ -10,7 +10,7 @@ LL | use foo::Bar;
help: you can use `as` to change the binding name of the import
|
LL | use foo::Bar as OtherBar;
| ^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

View file

@ -11,7 +11,7 @@ LL | use foo::foo;
help: you can use `as` to change the binding name of the import
|
LL | use foo::foo as other_foo;
| ^^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~~
error: aborting due to previous error

View file

@ -10,8 +10,9 @@ LL | &panic!()
found reference `&_`
help: consider removing the borrow
|
LL | panic!()
| --
LL - &panic!()
LL + panic!()
|
error: aborting due to previous error

View file

@ -7,11 +7,11 @@ LL | foo()
help: consider using a semicolon here
|
LL | foo();
| ^
| +
help: try adding a return type
|
LL | fn bar() -> usize {
| ^^^^^^^^
| ++++++++
error: aborting due to previous error

View file

@ -14,7 +14,7 @@ LL | spawn(|| books.push(4));
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
LL | spawn(move || books.push(4));
| ^^^^
| ++++
error: aborting due to previous error

View file

@ -14,7 +14,7 @@ LL | Box::new(|| books.push(4))
help: to force the closure to take ownership of `books` (and any other referenced variables), use the `move` keyword
|
LL | Box::new(move || books.push(4))
| ^^^^
| ++++
error: aborting due to previous error

View file

@ -12,8 +12,8 @@ LL | Foo { string: b }] => {
= note: move occurs because these variables have types that don't implement the `Copy` trait
help: consider removing the `&`
|
LL | [Foo { string: a },
LL | Foo { string: b }] => {
LL ~ [Foo { string: a },
LL ~ Foo { string: b }] => {
|
error: aborting due to previous error

View file

@ -34,7 +34,7 @@ LL | f(1, 2);
help: consider further restricting this bound
|
LL | fn c<F:FnOnce(isize, isize) -> isize + Copy>(f: F) {
| ^^^^^^
| ++++++
error: aborting due to 3 previous errors

View file

@ -36,12 +36,12 @@ LL | &mut [_a,
|
help: consider removing the `&mut`
|
LL | [_a,
LL |
LL |
LL |
LL | ..
LL | ] => {
LL ~ [_a,
LL +
LL +
LL +
LL + ..
LL ~ ] => {
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice
@ -68,9 +68,9 @@ LL | _b] => {}
|
help: consider removing the `&mut`
|
LL | [
LL |
LL | _b] => {}
LL ~ [
LL +
LL ~ _b] => {}
|
error[E0508]: cannot move out of type `[Box<isize>]`, a non-copy slice

View file

@ -8,7 +8,7 @@ LL | if let Some(thing) = maybe {
help: borrow this field in the pattern to avoid moving `maybe.0`
|
LL | if let Some(ref thing) = maybe {
| ^^^
| +++
error: aborting due to previous error

View file

@ -26,7 +26,7 @@ LL | struct LockedMarket<T>(T);
help: add missing generic argument
|
LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_, T> {
| ^^^
| +++
error[E0515]: cannot return value referencing temporary value
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:19:5

View file

@ -8,7 +8,7 @@ LL | if let Some(mut _x) = opt {}
help: borrow this field in the pattern to avoid moving `opt.0`
|
LL | if let Some(ref mut _x) = opt {}
| ^^^
| +++
error: aborting due to previous error

View file

@ -11,7 +11,7 @@ LL | foo(s);
help: borrow this field in the pattern to avoid moving `s.0`
|
LL | if let Some(ref mut x) = s {
| ^^^
| +++
error[E0382]: use of partially moved value: `e`
--> $DIR/move-in-pattern-mut.rs:22:9
@ -26,7 +26,7 @@ LL | bar(e);
help: borrow this field in the pattern to avoid moving `e.s`
|
LL | let E::V { s: ref mut x } = e;
| ^^^
| +++
error: aborting due to 2 previous errors

View file

@ -11,7 +11,7 @@ LL | foo(s);
help: borrow this field in the pattern to avoid moving `s.0`
|
LL | if let Some(ref x) = s {
| ^^^
| +++
error[E0382]: use of partially moved value: `e`
--> $DIR/move-in-pattern.rs:23:9
@ -26,7 +26,7 @@ LL | bar(e);
help: borrow this field in the pattern to avoid moving `e.s`
|
LL | let E::V { s: ref x } = e;
| ^^^
| +++
error: aborting due to 2 previous errors

View file

@ -10,7 +10,7 @@ LL | Other::handle(value);
help: consider creating a fresh reborrow of `value` here
|
LL | Other::handle(&mut *value);
| ^^^^^^
| ++++++
error: aborting due to previous error

View file

@ -8,7 +8,7 @@ LL | println!("{:?}", t);
help: consider further restricting this bound
|
LL | fn test_impl(t: impl Sized + std::fmt::Debug) {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:15:22
@ -20,7 +20,7 @@ LL | println!("{:?}", t);
help: consider restricting type parameter `T`
|
LL | fn test_no_bounds<T: std::fmt::Debug>(t: T) {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0277]: `T` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:21:22
@ -32,7 +32,7 @@ LL | println!("{:?}", t);
help: consider further restricting this bound
|
LL | fn test_one_bound<T: Sized + std::fmt::Debug>(t: T) {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0277]: `Y` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:27:30
@ -44,7 +44,7 @@ LL | println!("{:?} {:?}", x, y);
help: consider further restricting type parameter `Y`
|
LL | fn test_no_bounds_where<X, Y>(x: X, y: Y) where X: std::fmt::Debug, Y: std::fmt::Debug {
| ^^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~~
error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:33:22
@ -56,7 +56,7 @@ LL | println!("{:?}", x);
help: consider further restricting this bound
|
LL | fn test_one_bound_where<X>(x: X) where X: Sized + std::fmt::Debug {
| ^^^^^^^^^^^^^^^^^
| +++++++++++++++++
error[E0277]: `X` doesn't implement `Debug`
--> $DIR/bound-suggestions.rs:39:22
@ -68,7 +68,7 @@ LL | println!("{:?}", x);
help: consider further restricting type parameter `X`
|
LL | fn test_many_bounds_where<X>(x: X) where X: Sized, X: Sized, X: std::fmt::Debug {
| ^^^^^^^^^^^^^^^^^^^^
| ++++++++++++++++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:44:46
@ -84,7 +84,7 @@ LL | pub const fn size_of<T>() -> usize {
help: consider further restricting `Self`
|
LL | trait Foo<T>: Sized {
| ^^^^^^^
| +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:49:46
@ -100,7 +100,7 @@ LL | pub const fn size_of<T>() -> usize {
help: consider further restricting `Self`
|
LL | trait Bar: std::fmt::Display + Sized {
| ^^^^^^^
| +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:54:46
@ -116,7 +116,7 @@ LL | pub const fn size_of<T>() -> usize {
help: consider further restricting `Self`
|
LL | trait Baz: Sized where Self: std::fmt::Display {
| ^^^^^^^
| +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:59:46
@ -132,7 +132,7 @@ LL | pub const fn size_of<T>() -> usize {
help: consider further restricting `Self`
|
LL | trait Qux<T>: Sized where Self: std::fmt::Display {
| ^^^^^^^
| +++++++
error[E0277]: the size for values of type `Self` cannot be known at compilation time
--> $DIR/bound-suggestions.rs:64:46
@ -148,7 +148,7 @@ LL | pub const fn size_of<T>() -> usize {
help: consider further restricting `Self`
|
LL | trait Bat<T>: std::fmt::Display + Sized {
| ^^^^^^^
| +++++++
error: aborting due to 11 previous errors

View file

@ -11,7 +11,7 @@ LL | impl <T: Sync+'static> Foo for (T,) { }
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for (T,) { }
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error[E0277]: `T` cannot be shared between threads safely
--> $DIR/builtin-superkinds-double-superkind.rs:9:16
@ -26,7 +26,7 @@ LL | impl <T: Send> Foo for (T,T) { }
help: consider further restricting this bound
|
LL | impl <T: Send + std::marker::Sync> Foo for (T,T) { }
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error: aborting due to 2 previous errors

View file

@ -17,7 +17,7 @@ LL | struct X<T>(T);
help: consider further restricting this bound
|
LL | impl <T:Sync+'static + std::marker::Send> RequiresRequiresShareAndSend for X<T> { }
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | impl <T: Sync+'static> Foo for T { }
help: consider further restricting this bound
|
LL | impl <T: Sync+'static + std::marker::Send> Foo for T { }
| ^^^^^^^^^^^^^^^^^^^
| +++++++++++++++++++
error: aborting due to previous error

View file

@ -72,11 +72,11 @@ LL | pub trait Fn<Args>: FnMut<Args> {
help: a trait with a similar name exists
|
LL | self , ... , self , self , ... ) where Fn : FnOnce ( & 'a & 'b usize ) {
| ^^
| ~~
help: you might be missing a type parameter
|
LL | fn ordering4 < 'a , 'b, F > ( a : , self , self , self ,
| ^^^
| +++
error[E0491]: in type `&'a &'b usize`, reference has a longer lifetime than the data it references
--> $DIR/issue-86053-1.rs:11:52

View file

@ -8,7 +8,7 @@ LL | ) -> &usize {
help: consider using the `'static` lifetime
|
LL | ) -> &'static usize {
| ^^^^^^^^
| ~~~~~~~~
error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | let _pointer_to_something = something as *const Something;
help: consider borrowing the value
|
LL | let _pointer_to_something = &something as *const Something;
| ^
| +
error[E0605]: non-primitive cast: `Something` as `*mut Something`
--> $DIR/issue-84213.rs:14:37
@ -18,7 +18,7 @@ LL | let _mut_pointer_to_something = something as *mut Something;
help: consider borrowing the value
|
LL | let _mut_pointer_to_something = &mut something as *mut Something;
| ^^^^
| ++++
error: aborting due to 2 previous errors

View file

@ -15,7 +15,7 @@ LL | fn foo () -> impl FnMut()->() {
help: to force the closure to take ownership of `p` (and any other referenced variables), use the `move` keyword
|
LL | let mut c = move || {
| ^^^^
| ++++
error: aborting due to previous error

View file

@ -15,12 +15,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr` to be fully captured
|
LL | thread::spawn(move || { let _ = &fptr; unsafe {
LL |
LL |
LL |
LL |
LL | *fptr.0 = 20;
LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
LL +
LL +
LL +
LL +
LL + *fptr.0 = 20;
...
error: changes to closure capture in Rust 2021 will affect `Sync`, `Send` trait implementation for closure
@ -35,12 +35,12 @@ LL | *fptr.0.0 = 20;
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `fptr` to be fully captured
|
LL | thread::spawn(move || { let _ = &fptr; unsafe {
LL |
LL |
LL |
LL |
LL | *fptr.0.0 = 20;
LL ~ thread::spawn(move || { let _ = &fptr; unsafe {
LL +
LL +
LL +
LL +
LL + *fptr.0.0 = 20;
...
error: changes to closure capture in Rust 2021 will affect `Clone` trait implementation for closure and drop order
@ -58,12 +58,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `f` to be fully captured
|
LL | let c = || { let _ = &f;
LL |
LL |
LL |
LL |
LL | let f_1 = f.1;
LL ~ let c = || { let _ = &f;
LL +
LL +
LL +
LL +
LL + let f_1 = f.1;
...
error: aborting due to 3 previous errors

View file

@ -28,12 +28,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1`, `t2` to be fully captured
|
LL | let c = || { let _ = (&t, &t1, &t2);
LL |
LL |
LL |
LL |
LL | let _t = t.0;
LL ~ let c = || { let _ = (&t, &t1, &t2);
LL +
LL +
LL +
LL +
LL + let _t = t.0;
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -57,12 +57,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t`, `t1` to be fully captured
|
LL | let c = || { let _ = (&t, &t1);
LL |
LL |
LL |
LL | let _t = t.0;
LL |
LL ~ let c = || { let _ = (&t, &t1);
LL +
LL +
LL +
LL + let _t = t.0;
LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -80,12 +80,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t;
LL |
LL |
LL |
LL | let _t = t.0;
LL |
LL ~ let c = || { let _ = &t;
LL +
LL +
LL +
LL + let _t = t.0;
LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -103,12 +103,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t;
LL |
LL |
LL |
LL | let _t = t.0;
LL |
LL ~ let c = || { let _ = &t;
LL +
LL +
LL +
LL + let _t = t.0;
LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -126,12 +126,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t;
LL |
LL |
LL |
LL | let _t = t.0;
LL |
LL ~ let c = || { let _ = &t;
LL +
LL +
LL +
LL + let _t = t.0;
LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -154,12 +154,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t1`, `t` to be fully captured
|
LL | let c = move || { let _ = (&t1, &t);
LL |
LL |
LL |
LL | println!("{} {}", t1.1, t.1);
LL |
LL ~ let c = move || { let _ = (&t1, &t);
LL +
LL +
LL +
LL + println!("{} {}", t1.1, t.1);
LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -177,12 +177,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t;
LL |
LL |
LL |
LL | let _t = t.0;
LL |
LL ~ let c = || { let _ = &t;
LL +
LL +
LL +
LL + let _t = t.0;
LL +
...
error: aborting due to 7 previous errors

View file

@ -18,12 +18,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t;
LL |
LL |
LL |
LL | let _t = t.0;
LL |
LL ~ let c = || { let _ = &t;
LL +
LL +
LL +
LL + let _t = t.0;
LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -41,12 +41,12 @@ LL | }
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = move || { let _ = &t;
LL |
LL |
LL |
LL | let _t = t.1;
LL |
LL ~ let c = move || { let _ = &t;
LL +
LL +
LL +
LL + let _t = t.1;
LL +
...
error: aborting due to 2 previous errors

View file

@ -18,12 +18,12 @@ LL | #![deny(rust_2021_incompatible_closure_captures)]
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/disjoint-capture-in-closures.html>
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t;
LL |
LL |
LL |
LL | let _t = t.0;
LL |
LL ~ let c = || { let _ = &t;
LL +
LL +
LL +
LL + let _t = t.0;
LL +
...
error: changes to closure capture in Rust 2021 will affect drop order
@ -41,7 +41,7 @@ LL | }
help: add a dummy let to cause `t` to be fully captured
|
LL | let c = || { let _ = &t; t.0 };
| ^^^^^^^^^^^^^^^^^^^
| ~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors

Some files were not shown because too many files have changed in this diff Show more