diff --git a/compiler/rustc_error_messages/src/lib.rs b/compiler/rustc_error_messages/src/lib.rs
index 40ed10e716597..010e5f060bf0b 100644
--- a/compiler/rustc_error_messages/src/lib.rs
+++ b/compiler/rustc_error_messages/src/lib.rs
@@ -135,7 +135,10 @@ pub fn fluent_bundle(
let fallback_locale = langid!("en-US");
let requested_fallback_locale = requested_locale.as_ref() == Some(&fallback_locale);
-
+ trace!(?requested_fallback_locale);
+ if requested_fallback_locale && additional_ftl_path.is_none() {
+ return Ok(None);
+ }
// If there is only `-Z additional-ftl-path`, assume locale is "en-US", otherwise use user
// provided locale.
let locale = requested_locale.clone().unwrap_or(fallback_locale);
@@ -153,7 +156,7 @@ pub fn fluent_bundle(
bundle.set_use_isolating(with_directionality_markers);
// If the user requests the default locale then don't try to load anything.
- if !requested_fallback_locale && let Some(requested_locale) = requested_locale {
+ if let Some(requested_locale) = requested_locale {
let mut found_resources = false;
for sysroot in user_provided_sysroot.iter_mut().chain(sysroot_candidates.iter_mut()) {
sysroot.push("share");
diff --git a/compiler/rustc_errors/src/translation.rs b/compiler/rustc_errors/src/translation.rs
index 1ac9b8e03c7c3..ed35eb1b6c4ad 100644
--- a/compiler/rustc_errors/src/translation.rs
+++ b/compiler/rustc_errors/src/translation.rs
@@ -1,4 +1,4 @@
-use crate::error::TranslateError;
+use crate::error::{TranslateError, TranslateErrorKind};
use crate::snippet::Style;
use crate::{DiagnosticArg, DiagnosticMessage, FluentBundle};
use rustc_data_structures::sync::Lrc;
@@ -95,6 +95,16 @@ pub trait Translate {
// The primary bundle was present and translation succeeded
Some(Ok(t)) => t,
+ // If `translate_with_bundle` returns `Err` with the primary bundle, this is likely
+ // just that the primary bundle doesn't contain the message being translated, so
+ // proceed to the fallback bundle.
+ Some(Err(
+ primary @ TranslateError::One {
+ kind: TranslateErrorKind::MessageMissing, ..
+ },
+ )) => translate_with_bundle(self.fallback_fluent_bundle())
+ .map_err(|fallback| primary.and(fallback))?,
+
// Always yeet out for errors on debug (unless
// `RUSTC_TRANSLATION_NO_DEBUG_ASSERT` is set in the environment - this allows
// local runs of the test suites, of builds with debug assertions, to test the
@@ -106,9 +116,8 @@ pub trait Translate {
do yeet primary
}
- // If `translate_with_bundle` returns `Err` with the primary bundle, this is likely
- // just that the primary bundle doesn't contain the message being translated or
- // something else went wrong) so proceed to the fallback bundle.
+ // ..otherwise, for end users, an error about this wouldn't be useful or actionable, so
+ // just hide it and try with the fallback bundle.
Some(Err(primary)) => translate_with_bundle(self.fallback_fluent_bundle())
.map_err(|fallback| primary.and(fallback))?,
diff --git a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
index 2cb0d430ee340..cae884ae8fb73 100644
--- a/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
+++ b/compiler/rustc_hir_analysis/src/structured_errors/wrong_number_of_generic_args.rs
@@ -462,7 +462,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
if self.gen_args.span_ext().is_some() {
format!(
- "this {} takes {}{} {} argument{} but {} {} supplied",
+ "{} takes {}{} {} argument{} but {} {} supplied",
def_kind,
quantifier,
bound,
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 9d8ad9d9ed9f6..46ec1a2dca1f7 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -4103,3 +4103,33 @@ declare_lint! {
};
report_in_external_macro
}
+
+declare_lint! {
+ /// The `invalid_macro_export_arguments` lint detects cases where `#[macro_export]` is being used with invalid arguments.
+ ///
+ /// ### Example
+ ///
+ /// ```rust,compile_fail
+ /// #![deny(invalid_macro_export_arguments)]
+ ///
+ /// #[macro_export(invalid_parameter)]
+ /// macro_rules! myMacro {
+ /// () => {
+ /// // [...]
+ /// }
+ /// }
+ ///
+ /// #[macro_export(too, many, items)]
+ /// ```
+ ///
+ /// {{produces}}
+ ///
+ /// ### Explanation
+ ///
+ /// The only valid argument is `#[macro_export(local_inner_macros)]` or no argument (`#[macro_export]`).
+ /// You can't have multiple arguments in a `#[macro_export(..)]`, or mention arguments other than `local_inner_macros`.
+ ///
+ pub INVALID_MACRO_EXPORT_ARGUMENTS,
+ Warn,
+ "\"invalid_parameter\" isn't a valid argument for `#[macro_export]`",
+}
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 623c82b37e07d..fda9151478f68 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -982,7 +982,11 @@ impl<'a> Parser<'a> {
let initial_semicolon = self.token.span;
while self.eat(&TokenKind::Semi) {
- let _ = self.parse_stmt(ForceCollect::Yes)?;
+ let _ =
+ self.parse_stmt_without_recovery(false, ForceCollect::Yes).unwrap_or_else(|e| {
+ e.cancel();
+ None
+ });
}
expect_err.set_primary_message(
diff --git a/compiler/rustc_passes/locales/en-US.ftl b/compiler/rustc_passes/locales/en-US.ftl
index 0c7e02912d4ef..0ed29ce0d4795 100644
--- a/compiler/rustc_passes/locales/en-US.ftl
+++ b/compiler/rustc_passes/locales/en-US.ftl
@@ -407,10 +407,10 @@ passes_duplicate_diagnostic_item =
passes_duplicate_diagnostic_item_in_crate =
duplicate diagnostic item in crate `{$crate_name}`: `{$name}`.
+ .note = the diagnostic item is first defined in crate `{$orig_crate_name}`.
passes_diagnostic_item_first_defined =
the diagnostic item is first defined here
- .note = the diagnostic item is first defined in crate `{$orig_crate_name}`.
passes_abi =
abi: {$abi}
@@ -745,3 +745,7 @@ passes_proc_macro_invalid_abi = proc macro functions may not be `extern "{$abi}"
passes_proc_macro_unsafe = proc macro functions may not be `unsafe`
passes_skipping_const_checks = skipping const checks
+
+passes_invalid_macro_export_arguments = `{$name}` isn't a valid `#[macro_export]` argument
+
+passes_invalid_macro_export_arguments_too_many_items = `#[macro_export]` can only take 1 or 0 arguments
diff --git a/compiler/rustc_passes/src/check_attr.rs b/compiler/rustc_passes/src/check_attr.rs
index bb09dcbdd6980..5ef3e13eff801 100644
--- a/compiler/rustc_passes/src/check_attr.rs
+++ b/compiler/rustc_passes/src/check_attr.rs
@@ -23,7 +23,8 @@ use rustc_middle::ty::fast_reject::{DeepRejectCtxt, TreatParams};
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::{ParamEnv, TyCtxt};
use rustc_session::lint::builtin::{
- CONFLICTING_REPR_HINTS, INVALID_DOC_ATTRIBUTES, UNUSED_ATTRIBUTES,
+ CONFLICTING_REPR_HINTS, INVALID_DOC_ATTRIBUTES, INVALID_MACRO_EXPORT_ARGUMENTS,
+ UNUSED_ATTRIBUTES,
};
use rustc_session::parse::feature_err;
use rustc_span::symbol::{kw, sym, Symbol};
@@ -2102,7 +2103,33 @@ impl CheckAttrVisitor<'_> {
fn check_macro_export(&self, hir_id: HirId, attr: &Attribute, target: Target) {
if target != Target::MacroDef {
- self.tcx.emit_spanned_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::MacroExport);
+ self.tcx.emit_spanned_lint(
+ UNUSED_ATTRIBUTES,
+ hir_id,
+ attr.span,
+ errors::MacroExport::Normal,
+ );
+ } else if let Some(meta_item_list) = attr.meta_item_list() &&
+ !meta_item_list.is_empty() {
+ if meta_item_list.len() > 1 {
+ self.tcx.emit_spanned_lint(
+ INVALID_MACRO_EXPORT_ARGUMENTS,
+ hir_id,
+ attr.span,
+ errors::MacroExport::TooManyItems,
+ );
+ } else {
+ if meta_item_list[0].name_or_empty() != sym::local_inner_macros {
+ self.tcx.emit_spanned_lint(
+ INVALID_MACRO_EXPORT_ARGUMENTS,
+ hir_id,
+ meta_item_list[0].span(),
+ errors::MacroExport::UnknownItem {
+ name: meta_item_list[0].name_or_empty(),
+ },
+ );
+ }
+ }
}
}
diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs
index 82fc3eeff94ab..2c0d21b479848 100644
--- a/compiler/rustc_passes/src/errors.rs
+++ b/compiler/rustc_passes/src/errors.rs
@@ -641,8 +641,16 @@ pub struct MacroUse {
}
#[derive(LintDiagnostic)]
-#[diag(passes_macro_export)]
-pub struct MacroExport;
+pub enum MacroExport {
+ #[diag(passes_macro_export)]
+ Normal,
+
+ #[diag(passes_invalid_macro_export_arguments)]
+ UnknownItem { name: Symbol },
+
+ #[diag(passes_invalid_macro_export_arguments_too_many_items)]
+ TooManyItems,
+}
#[derive(LintDiagnostic)]
#[diag(passes_plugin_registrar)]
diff --git a/library/core/src/num/int_macros.rs b/library/core/src/num/int_macros.rs
index 572191d0f9bbb..aec15212d7ff7 100644
--- a/library/core/src/num/int_macros.rs
+++ b/library/core/src/num/int_macros.rs
@@ -3,21 +3,26 @@ macro_rules! int_impl {
Self = $SelfT:ty,
ActualT = $ActualT:ident,
UnsignedT = $UnsignedT:ty,
- BITS = $BITS:expr,
- BITS_MINUS_ONE = $BITS_MINUS_ONE:expr,
- Min = $Min:expr,
- Max = $Max:expr,
- rot = $rot:expr,
- rot_op = $rot_op:expr,
- rot_result = $rot_result:expr,
- swap_op = $swap_op:expr,
- swapped = $swapped:expr,
- reversed = $reversed:expr,
- le_bytes = $le_bytes:expr,
- be_bytes = $be_bytes:expr,
+
+ // There are all for use *only* in doc comments.
+ // As such, they're all passed as literals -- passing them as a string
+ // literal is fine if they need to be multiple code tokens.
+ // In non-comments, use the associated constants rather than these.
+ BITS = $BITS:literal,
+ BITS_MINUS_ONE = $BITS_MINUS_ONE:literal,
+ Min = $Min:literal,
+ Max = $Max:literal,
+ rot = $rot:literal,
+ rot_op = $rot_op:literal,
+ rot_result = $rot_result:literal,
+ swap_op = $swap_op:literal,
+ swapped = $swapped:literal,
+ reversed = $reversed:literal,
+ le_bytes = $le_bytes:literal,
+ be_bytes = $be_bytes:literal,
to_xe_bytes_doc = $to_xe_bytes_doc:expr,
from_xe_bytes_doc = $from_xe_bytes_doc:expr,
- bound_condition = $bound_condition:expr,
+ bound_condition = $bound_condition:literal,
) => {
/// The smallest value that can be represented by this integer type
#[doc = concat!("(−2", $BITS_MINUS_ONE, "", $bound_condition, ").")]
@@ -30,7 +35,7 @@ macro_rules! int_impl {
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MIN, ", stringify!($Min), ");")]
/// ```
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
- pub const MIN: Self = !0 ^ ((!0 as $UnsignedT) >> 1) as Self;
+ pub const MIN: Self = !Self::MAX;
/// The largest value that can be represented by this integer type
#[doc = concat!("(2", $BITS_MINUS_ONE, " − 1", $bound_condition, ").")]
@@ -43,7 +48,7 @@ macro_rules! int_impl {
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX, ", stringify!($Max), ");")]
/// ```
#[stable(feature = "assoc_int_consts", since = "1.43.0")]
- pub const MAX: Self = !Self::MIN;
+ pub const MAX: Self = (<$UnsignedT>::MAX >> 1) as Self;
/// The size of this integer type in bits.
///
@@ -53,7 +58,7 @@ macro_rules! int_impl {
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::BITS, ", stringify!($BITS), ");")]
/// ```
#[stable(feature = "int_bits_const", since = "1.53.0")]
- pub const BITS: u32 = $BITS;
+ pub const BITS: u32 = <$UnsignedT>::BITS;
/// Converts a string slice in a given base to an integer.
///
@@ -1380,7 +1385,7 @@ macro_rules! int_impl {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
unsafe {
- self.unchecked_shl(rhs & ($BITS - 1))
+ self.unchecked_shl(rhs & (Self::BITS - 1))
}
}
@@ -1410,7 +1415,7 @@ macro_rules! int_impl {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
unsafe {
- self.unchecked_shr(rhs & ($BITS - 1))
+ self.unchecked_shr(rhs & (Self::BITS - 1))
}
}
@@ -1916,7 +1921,7 @@ macro_rules! int_impl {
without modifying the original"]
#[inline]
pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
- (self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
+ (self.wrapping_shl(rhs), rhs >= Self::BITS)
}
/// Shifts self right by `rhs` bits.
@@ -1939,7 +1944,7 @@ macro_rules! int_impl {
without modifying the original"]
#[inline]
pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
- (self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
+ (self.wrapping_shr(rhs), rhs >= Self::BITS)
}
/// Computes the absolute value of `self`.
diff --git a/library/core/src/num/uint_macros.rs b/library/core/src/num/uint_macros.rs
index c4fe8e966fdbf..932038a0b012a 100644
--- a/library/core/src/num/uint_macros.rs
+++ b/library/core/src/num/uint_macros.rs
@@ -4,19 +4,24 @@ macro_rules! uint_impl {
ActualT = $ActualT:ident,
SignedT = $SignedT:ident,
NonZeroT = $NonZeroT:ident,
- BITS = $BITS:expr,
- MAX = $MaxV:expr,
- rot = $rot:expr,
- rot_op = $rot_op:expr,
- rot_result = $rot_result:expr,
- swap_op = $swap_op:expr,
- swapped = $swapped:expr,
- reversed = $reversed:expr,
- le_bytes = $le_bytes:expr,
- be_bytes = $be_bytes:expr,
+
+ // There are all for use *only* in doc comments.
+ // As such, they're all passed as literals -- passing them as a string
+ // literal is fine if they need to be multiple code tokens.
+ // In non-comments, use the associated constants rather than these.
+ BITS = $BITS:literal,
+ MAX = $MaxV:literal,
+ rot = $rot:literal,
+ rot_op = $rot_op:literal,
+ rot_result = $rot_result:literal,
+ swap_op = $swap_op:literal,
+ swapped = $swapped:literal,
+ reversed = $reversed:literal,
+ le_bytes = $le_bytes:literal,
+ be_bytes = $be_bytes:literal,
to_xe_bytes_doc = $to_xe_bytes_doc:expr,
from_xe_bytes_doc = $from_xe_bytes_doc:expr,
- bound_condition = $bound_condition:expr,
+ bound_condition = $bound_condition:literal,
) => {
/// The smallest value that can be represented by this integer type.
///
@@ -51,7 +56,7 @@ macro_rules! uint_impl {
#[doc = concat!("assert_eq!(", stringify!($SelfT), "::BITS, ", stringify!($BITS), ");")]
/// ```
#[stable(feature = "int_bits_const", since = "1.53.0")]
- pub const BITS: u32 = $BITS;
+ pub const BITS: u32 = Self::MAX.count_ones();
/// Converts a string slice in a given base to an integer.
///
@@ -1403,7 +1408,7 @@ macro_rules! uint_impl {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
unsafe {
- self.unchecked_shl(rhs & ($BITS - 1))
+ self.unchecked_shl(rhs & (Self::BITS - 1))
}
}
@@ -1436,7 +1441,7 @@ macro_rules! uint_impl {
// SAFETY: the masking by the bitsize of the type ensures that we do not shift
// out of bounds
unsafe {
- self.unchecked_shr(rhs & ($BITS - 1))
+ self.unchecked_shr(rhs & (Self::BITS - 1))
}
}
@@ -1860,7 +1865,7 @@ macro_rules! uint_impl {
without modifying the original"]
#[inline(always)]
pub const fn overflowing_shl(self, rhs: u32) -> (Self, bool) {
- (self.wrapping_shl(rhs), (rhs > ($BITS - 1)))
+ (self.wrapping_shl(rhs), rhs >= Self::BITS)
}
/// Shifts self right by `rhs` bits.
@@ -1885,7 +1890,7 @@ macro_rules! uint_impl {
without modifying the original"]
#[inline(always)]
pub const fn overflowing_shr(self, rhs: u32) -> (Self, bool) {
- (self.wrapping_shr(rhs), (rhs > ($BITS - 1)))
+ (self.wrapping_shr(rhs), rhs >= Self::BITS)
}
/// Raises self to the power of `exp`, using exponentiation by squaring.
diff --git a/library/std/src/sys/windows/c.rs b/library/std/src/sys/windows/c.rs
index f58dcf1287bef..1d0ab7727394a 100644
--- a/library/std/src/sys/windows/c.rs
+++ b/library/std/src/sys/windows/c.rs
@@ -539,14 +539,6 @@ pub struct SYMBOLIC_LINK_REPARSE_BUFFER {
pub PathBuffer: WCHAR,
}
-/// NB: Use carefully! In general using this as a reference is likely to get the
-/// provenance wrong for the `PathBuffer` field!
-#[repr(C)]
-pub struct FILE_NAME_INFO {
- pub FileNameLength: DWORD,
- pub FileName: [WCHAR; 1],
-}
-
#[repr(C)]
pub struct MOUNT_POINT_REPARSE_BUFFER {
pub SubstituteNameOffset: c_ushort,
diff --git a/library/std/src/sys/windows/io.rs b/library/std/src/sys/windows/io.rs
index 2cc34c986b990..7fdd1f702e2fd 100644
--- a/library/std/src/sys/windows/io.rs
+++ b/library/std/src/sys/windows/io.rs
@@ -2,8 +2,7 @@ use crate::marker::PhantomData;
use crate::mem::size_of;
use crate::os::windows::io::{AsHandle, AsRawHandle, BorrowedHandle};
use crate::slice;
-use crate::sys::{c, Align8};
-use core;
+use crate::sys::c;
use libc;
#[derive(Copy, Clone)]
@@ -125,22 +124,33 @@ unsafe fn msys_tty_on(handle: c::HANDLE) -> bool {
return false;
}
- const SIZE: usize = size_of::() + c::MAX_PATH * size_of::();
- let mut name_info_bytes = Align8([0u8; SIZE]);
+ /// Mirrors [`FILE_NAME_INFO`], giving it a fixed length that we can stack
+ /// allocate
+ ///
+ /// [`FILE_NAME_INFO`]: https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_name_info
+ #[repr(C)]
+ #[allow(non_snake_case)]
+ struct FILE_NAME_INFO {
+ FileNameLength: u32,
+ FileName: [u16; c::MAX_PATH as usize],
+ }
+ let mut name_info = FILE_NAME_INFO { FileNameLength: 0, FileName: [0; c::MAX_PATH as usize] };
+ // Safety: buffer length is fixed.
let res = c::GetFileInformationByHandleEx(
handle,
c::FileNameInfo,
- name_info_bytes.0.as_mut_ptr() as *mut libc::c_void,
- SIZE as u32,
+ &mut name_info as *mut _ as *mut libc::c_void,
+ size_of::() as u32,
);
if res == 0 {
return false;
}
- let name_info: &c::FILE_NAME_INFO = &*(name_info_bytes.0.as_ptr() as *const c::FILE_NAME_INFO);
- let name_len = name_info.FileNameLength as usize / 2;
- // Offset to get the `FileName` field.
- let name_ptr = name_info_bytes.0.as_ptr().offset(size_of::() as isize).cast::();
- let s = core::slice::from_raw_parts(name_ptr, name_len);
+
+ // Use `get` because `FileNameLength` can be out of range.
+ let s = match name_info.FileName.get(..name_info.FileNameLength as usize / 2) {
+ None => return false,
+ Some(s) => s,
+ };
let name = String::from_utf16_lossy(s);
// Get the file name only.
let name = name.rsplit('\\').next().unwrap_or(&name);
diff --git a/tests/rustdoc-ui/unable-fulfill-trait.stderr b/tests/rustdoc-ui/unable-fulfill-trait.stderr
index a16b5b6eb2f56..72f35cb922445 100644
--- a/tests/rustdoc-ui/unable-fulfill-trait.stderr
+++ b/tests/rustdoc-ui/unable-fulfill-trait.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/unable-fulfill-trait.rs:4:17
|
LL | field1: dyn Bar<'a, 'b,>,
diff --git a/tests/ui/argument-suggestions/issue-100154.stderr b/tests/ui/argument-suggestions/issue-100154.stderr
index 1499229c3ced2..2504f616fb7e1 100644
--- a/tests/ui/argument-suggestions/issue-100154.stderr
+++ b/tests/ui/argument-suggestions/issue-100154.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-100154.rs:4:5
|
LL | foo::<()>(());
diff --git a/tests/ui/async-await/issues/issue-65159.rs b/tests/ui/async-await/issues/issue-65159.rs
index df2ca025705d3..6e547508bd469 100644
--- a/tests/ui/async-await/issues/issue-65159.rs
+++ b/tests/ui/async-await/issues/issue-65159.rs
@@ -3,7 +3,7 @@
// edition:2018
async fn copy() -> Result<()>
-//~^ ERROR this enum takes 2 generic arguments
+//~^ ERROR enum takes 2 generic arguments
{
Ok(())
}
diff --git a/tests/ui/async-await/issues/issue-65159.stderr b/tests/ui/async-await/issues/issue-65159.stderr
index 40c0e72b20391..b8741333c3283 100644
--- a/tests/ui/async-await/issues/issue-65159.stderr
+++ b/tests/ui/async-await/issues/issue-65159.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied
+error[E0107]: enum takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/issue-65159.rs:5:20
|
LL | async fn copy() -> Result<()>
diff --git a/tests/ui/attributes/invalid_macro_export_argument.rs b/tests/ui/attributes/invalid_macro_export_argument.rs
new file mode 100644
index 0000000000000..85d009f11a6f3
--- /dev/null
+++ b/tests/ui/attributes/invalid_macro_export_argument.rs
@@ -0,0 +1,26 @@
+// check-pass
+#[macro_export(hello, world)] //~ WARN `#[macro_export]` can only take 1 or 0 arguments
+macro_rules! a {
+ () => ()
+}
+
+#[macro_export(not_local_inner_macros)] //~ WARN `not_local_inner_macros` isn't a valid `#[macro_export]` argument
+macro_rules! b {
+ () => ()
+}
+
+#[macro_export]
+macro_rules! c {
+ () => ()
+}
+#[macro_export(local_inner_macros)]
+macro_rules! d {
+ () => ()
+}
+
+#[macro_export()]
+macro_rules! e {
+ () => ()
+}
+
+fn main() {}
diff --git a/tests/ui/attributes/invalid_macro_export_argument.stderr b/tests/ui/attributes/invalid_macro_export_argument.stderr
new file mode 100644
index 0000000000000..a4e17642c2aac
--- /dev/null
+++ b/tests/ui/attributes/invalid_macro_export_argument.stderr
@@ -0,0 +1,16 @@
+warning: `#[macro_export]` can only take 1 or 0 arguments
+ --> $DIR/invalid_macro_export_argument.rs:2:1
+ |
+LL | #[macro_export(hello, world)]
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: `#[warn(invalid_macro_export_arguments)]` on by default
+
+warning: `not_local_inner_macros` isn't a valid `#[macro_export]` argument
+ --> $DIR/invalid_macro_export_argument.rs:7:16
+ |
+LL | #[macro_export(not_local_inner_macros)]
+ | ^^^^^^^^^^^^^^^^^^^^^^
+
+warning: 2 warnings emitted
+
diff --git a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs
index dd0320bc53ba7..d067ff44704c7 100644
--- a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs
+++ b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs
@@ -14,8 +14,8 @@ impl MarketMultiplier {
}
async fn buy_lock(generator: &Mutex) -> LockedMarket<'_> {
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
- //~^^ ERROR this struct takes 1 generic argument but 0 generic arguments were supplied
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+ //~^^ ERROR struct takes 1 generic argument but 0 generic arguments were supplied
LockedMarket(generator.lock().unwrap().buy())
}
diff --git a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr
index d2b927fb664c6..73e0aaf1e45cc 100644
--- a/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr
+++ b/tests/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59
|
LL | async fn buy_lock(generator: &Mutex) -> LockedMarket<'_> {
@@ -12,7 +12,7 @@ note: struct defined here, with 0 lifetime parameters
LL | struct LockedMarket(T);
| ^^^^^^^^^^^^
-error[E0107]: this struct takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:16:59
|
LL | async fn buy_lock(generator: &Mutex) -> LockedMarket<'_> {
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-102768.rs b/tests/ui/const-generics/generic_const_exprs/issue-102768.rs
index 7aea0d30d1a76..18a9b53cf7681 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-102768.rs
+++ b/tests/ui/const-generics/generic_const_exprs/issue-102768.rs
@@ -7,8 +7,8 @@ trait X {
const _: () = {
fn f2<'a>(arg: Box = &'a ()>>) {}
- //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
- //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
+ //~^ ERROR associated type takes 1 lifetime argument but 0 lifetime arguments
+ //~| ERROR associated type takes 0 generic arguments but 1 generic argument
};
fn main() {}
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr
index 8278edabe3a06..175d54e41848b 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-102768.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/issue-102768.rs:9:30
|
LL | fn f2<'a>(arg: Box = &'a ()>>) {}
@@ -14,7 +14,7 @@ help: add missing lifetime argument
LL | fn f2<'a>(arg: Box = &'a ()>>) {}
| +++
-error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-102768.rs:9:30
|
LL | fn f2<'a>(arg: Box = &'a ()>>) {}
diff --git a/tests/ui/const-generics/generic_const_exprs/issue-76595.stderr b/tests/ui/const-generics/generic_const_exprs/issue-76595.stderr
index c587a7e153fe3..302da59651ccb 100644
--- a/tests/ui/const-generics/generic_const_exprs/issue-76595.stderr
+++ b/tests/ui/const-generics/generic_const_exprs/issue-76595.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
+error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/issue-76595.rs:15:5
|
LL | test::<2>();
diff --git a/tests/ui/const-generics/incorrect-number-of-const-args.stderr b/tests/ui/const-generics/incorrect-number-of-const-args.stderr
index a845454f762cf..01ac4e69a057e 100644
--- a/tests/ui/const-generics/incorrect-number-of-const-args.stderr
+++ b/tests/ui/const-generics/incorrect-number-of-const-args.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
+error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/incorrect-number-of-const-args.rs:6:5
|
LL | foo::<0>();
@@ -16,7 +16,7 @@ help: add missing generic argument
LL | foo::<0, Y>();
| +++
-error[E0107]: this function takes 2 generic arguments but 3 generic arguments were supplied
+error[E0107]: function takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/incorrect-number-of-const-args.rs:9:5
|
LL | foo::<0, 0, 0>();
diff --git a/tests/ui/const-generics/invalid-const-arg-for-type-param.rs b/tests/ui/const-generics/invalid-const-arg-for-type-param.rs
index cdc54b214a84c..bf10f471dc51c 100644
--- a/tests/ui/const-generics/invalid-const-arg-for-type-param.rs
+++ b/tests/ui/const-generics/invalid-const-arg-for-type-param.rs
@@ -4,11 +4,11 @@ struct S;
fn main() {
let _: u32 = 5i32.try_into::<32>().unwrap();
- //~^ ERROR this method takes
+ //~^ ERROR method takes
S.f::<0>();
//~^ ERROR no method named `f`
S::<0>;
- //~^ ERROR this struct takes 0
+ //~^ ERROR struct takes 0
}
diff --git a/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr b/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr
index a9754bc46d728..4a649d8a7e881 100644
--- a/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr
+++ b/tests/ui/const-generics/invalid-const-arg-for-type-param.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/invalid-const-arg-for-type-param.rs:6:23
|
LL | let _: u32 = 5i32.try_into::<32>().unwrap();
@@ -23,7 +23,7 @@ LL | struct S;
LL | S.f::<0>();
| ^ method not found in `S`
-error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/invalid-const-arg-for-type-param.rs:12:5
|
LL | S::<0>;
diff --git a/tests/ui/const-generics/invalid-constant-in-args.rs b/tests/ui/const-generics/invalid-constant-in-args.rs
index 7419d4a25ce12..fd259197d2982 100644
--- a/tests/ui/const-generics/invalid-constant-in-args.rs
+++ b/tests/ui/const-generics/invalid-constant-in-args.rs
@@ -2,5 +2,5 @@ use std::cell::Cell;
fn main() {
let _: Cell<&str, "a"> = Cell::new("");
- //~^ ERROR this struct takes 1 generic argument but 2 generic arguments were supplied
+ //~^ ERROR struct takes 1 generic argument but 2 generic arguments were supplied
}
diff --git a/tests/ui/const-generics/invalid-constant-in-args.stderr b/tests/ui/const-generics/invalid-constant-in-args.stderr
index 993b63518e44c..2545cc6f39644 100644
--- a/tests/ui/const-generics/invalid-constant-in-args.stderr
+++ b/tests/ui/const-generics/invalid-constant-in-args.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/invalid-constant-in-args.rs:4:12
|
LL | let _: Cell<&str, "a"> = Cell::new("");
diff --git a/tests/ui/const-generics/issues/issue-87493.rs b/tests/ui/const-generics/issues/issue-87493.rs
index d8599ab22a32b..80472e6bd9c52 100644
--- a/tests/ui/const-generics/issues/issue-87493.rs
+++ b/tests/ui/const-generics/issues/issue-87493.rs
@@ -7,7 +7,7 @@ where
S: MyTrait,
T: MyTrait,
//~^ ERROR: expected one of `,` or `>`, found `==`
- //~| ERROR: this trait takes 0 generic arguments but 1 generic argument was supplied
+ //~| ERROR: trait takes 0 generic arguments but 1 generic argument was supplied
{
}
diff --git a/tests/ui/const-generics/issues/issue-87493.stderr b/tests/ui/const-generics/issues/issue-87493.stderr
index 653afae219115..73bd6ed73e674 100644
--- a/tests/ui/const-generics/issues/issue-87493.stderr
+++ b/tests/ui/const-generics/issues/issue-87493.stderr
@@ -9,7 +9,7 @@ help: if you meant to use an associated type binding, replace `==` with `=`
LL | T: MyTrait,
| ~
-error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-87493.rs:8:8
|
LL | T: MyTrait,
diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs
index b126b24853ff7..79743abe40935 100644
--- a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs
+++ b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.rs
@@ -7,7 +7,7 @@ struct Bar;
const T: usize = 42;
impl Foo for Bar {
-//~^ ERROR this trait takes 1 generic argument but 0 generic arguments were supplied
+//~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied
//~| ERROR associated type bindings are not allowed here
//~| ERROR associated const equality is incomplete
fn do_x(&self) -> [u8; 3] {
diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr
index acfdde8e1a01f..4f4e1aa3a046f 100644
--- a/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr
+++ b/tests/ui/const-generics/parser-error-recovery/issue-89013-no-kw.stderr
@@ -7,7 +7,7 @@ LL | impl Foo for Bar {
= note: see issue #92827 for more information
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/issue-89013-no-kw.rs:9:6
|
LL | impl Foo for Bar {
diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013.rs b/tests/ui/const-generics/parser-error-recovery/issue-89013.rs
index 9431779faf859..335d0d94e83c5 100644
--- a/tests/ui/const-generics/parser-error-recovery/issue-89013.rs
+++ b/tests/ui/const-generics/parser-error-recovery/issue-89013.rs
@@ -8,7 +8,7 @@ const T: usize = 42;
impl Foo for Bar {
//~^ ERROR expected lifetime, type, or constant, found keyword `const`
-//~| ERROR this trait takes 1 generic
+//~| ERROR trait takes 1 generic
//~| ERROR associated type bindings are not allowed here
//~| ERROR associated const equality is incomplete
fn do_x(&self) -> [u8; 3] {
diff --git a/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr b/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr
index 583749a85734e..3d2b98feb39c0 100644
--- a/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr
+++ b/tests/ui/const-generics/parser-error-recovery/issue-89013.stderr
@@ -19,7 +19,7 @@ LL | impl Foo for Bar {
= note: see issue #92827 for more information
= help: add `#![feature(associated_const_equality)]` to the crate attributes to enable
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/issue-89013.rs:9:6
|
LL | impl Foo for Bar {
diff --git a/tests/ui/constructor-lifetime-args.rs b/tests/ui/constructor-lifetime-args.rs
index a824a44c9c222..f5802e7d8b118 100644
--- a/tests/ui/constructor-lifetime-args.rs
+++ b/tests/ui/constructor-lifetime-args.rs
@@ -15,12 +15,12 @@ enum E<'a, 'b> {
fn main() {
S(&0, &0); // OK
S::<'static>(&0, &0);
- //~^ ERROR this struct takes 2 lifetime arguments
+ //~^ ERROR struct takes 2 lifetime arguments
S::<'static, 'static, 'static>(&0, &0);
- //~^ ERROR this struct takes 2 lifetime arguments
+ //~^ ERROR struct takes 2 lifetime arguments
E::V(&0); // OK
E::V::<'static>(&0);
- //~^ ERROR this enum takes 2 lifetime arguments
+ //~^ ERROR enum takes 2 lifetime arguments
E::V::<'static, 'static, 'static>(&0);
- //~^ ERROR this enum takes 2 lifetime arguments
+ //~^ ERROR enum takes 2 lifetime arguments
}
diff --git a/tests/ui/constructor-lifetime-args.stderr b/tests/ui/constructor-lifetime-args.stderr
index bc1141b16c55d..a18123fe19cba 100644
--- a/tests/ui/constructor-lifetime-args.stderr
+++ b/tests/ui/constructor-lifetime-args.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/constructor-lifetime-args.rs:17:5
|
LL | S::<'static>(&0, &0);
@@ -16,7 +16,7 @@ help: add missing lifetime argument
LL | S::<'static, 'static>(&0, &0);
| +++++++++
-error[E0107]: this struct takes 2 lifetime arguments but 3 lifetime arguments were supplied
+error[E0107]: struct takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:19:5
|
LL | S::<'static, 'static, 'static>(&0, &0);
@@ -30,7 +30,7 @@ note: struct defined here, with 2 lifetime parameters: `'a`, `'b`
LL | struct S<'a, 'b>(&'a u8, &'b u8);
| ^ -- --
-error[E0107]: this enum takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: enum takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/constructor-lifetime-args.rs:22:8
|
LL | E::V::<'static>(&0);
@@ -48,7 +48,7 @@ help: add missing lifetime argument
LL | E::V::<'static, 'static>(&0);
| +++++++++
-error[E0107]: this enum takes 2 lifetime arguments but 3 lifetime arguments were supplied
+error[E0107]: enum takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/constructor-lifetime-args.rs:24:8
|
LL | E::V::<'static, 'static, 'static>(&0);
diff --git a/tests/ui/error-codes/E0107.rs b/tests/ui/error-codes/E0107.rs
index d369fc2a5658b..fd23e7c00f2bf 100644
--- a/tests/ui/error-codes/E0107.rs
+++ b/tests/ui/error-codes/E0107.rs
@@ -11,39 +11,39 @@ enum Bar {
struct Baz<'a, 'b, 'c> {
buzz: Buzz<'a>,
- //~^ ERROR this struct takes 2 lifetime arguments
+ //~^ ERROR struct takes 2 lifetime arguments
//~| HELP add missing lifetime argument
bar: Bar<'a>,
- //~^ ERROR this enum takes 0 lifetime arguments
+ //~^ ERROR enum takes 0 lifetime arguments
//~| HELP remove these generics
foo2: Foo<'a, 'b, 'c>,
- //~^ ERROR this struct takes 1 lifetime argument
+ //~^ ERROR struct takes 1 lifetime argument
//~| HELP remove these lifetime arguments
qux1: Qux<'a, 'b, i32>,
- //~^ ERROR this struct takes 1 lifetime argument
+ //~^ ERROR struct takes 1 lifetime argument
//~| HELP remove this lifetime argument
qux2: Qux<'a, i32, 'b>,
- //~^ ERROR this struct takes 1 lifetime argument
+ //~^ ERROR struct takes 1 lifetime argument
//~| HELP remove this lifetime argument
qux3: Qux<'a, 'b, 'c, i32>,
- //~^ ERROR this struct takes 1 lifetime argument
+ //~^ ERROR struct takes 1 lifetime argument
//~| HELP remove these lifetime arguments
qux4: Qux<'a, i32, 'b, 'c>,
- //~^ ERROR this struct takes 1 lifetime argument
+ //~^ ERROR struct takes 1 lifetime argument
//~| HELP remove these lifetime arguments
qux5: Qux<'a, 'b, i32, 'c>,
- //~^ ERROR this struct takes 1 lifetime argument
+ //~^ ERROR struct takes 1 lifetime argument
//~| HELP remove this lifetime argument
quux: Quux<'a, i32, 'b>,
- //~^ ERROR this struct takes 0 lifetime arguments
+ //~^ ERROR struct takes 0 lifetime arguments
//~| HELP remove this lifetime argument
}
@@ -53,7 +53,7 @@ pub trait T {
}
fn trait_bound_generic>(_i: I) {
- //~^ ERROR this trait takes 0 generic arguments
+ //~^ ERROR trait takes 0 generic arguments
//~| HELP replace the generic bounds with the associated types
}
diff --git a/tests/ui/error-codes/E0107.stderr b/tests/ui/error-codes/E0107.stderr
index 03430f8fa3a0b..3f540eb08bc7c 100644
--- a/tests/ui/error-codes/E0107.stderr
+++ b/tests/ui/error-codes/E0107.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/E0107.rs:13:11
|
LL | buzz: Buzz<'a>,
@@ -16,7 +16,7 @@ help: add missing lifetime argument
LL | buzz: Buzz<'a, 'a>,
| ++++
-error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/E0107.rs:17:10
|
LL | bar: Bar<'a>,
@@ -30,7 +30,7 @@ note: enum defined here, with 0 lifetime parameters
LL | enum Bar {
| ^^^
-error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied
--> $DIR/E0107.rs:21:11
|
LL | foo2: Foo<'a, 'b, 'c>,
@@ -44,7 +44,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Foo<'a>(&'a str);
| ^^^ --
-error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/E0107.rs:25:11
|
LL | qux1: Qux<'a, 'b, i32>,
@@ -58,7 +58,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
-error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/E0107.rs:29:11
|
LL | qux2: Qux<'a, i32, 'b>,
@@ -72,7 +72,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
-error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied
--> $DIR/E0107.rs:33:11
|
LL | qux3: Qux<'a, 'b, 'c, i32>,
@@ -86,7 +86,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
-error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied
--> $DIR/E0107.rs:37:11
|
LL | qux4: Qux<'a, i32, 'b, 'c>,
@@ -100,7 +100,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
-error[E0107]: this struct takes 1 lifetime argument but 3 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 3 lifetime arguments were supplied
--> $DIR/E0107.rs:41:11
|
LL | qux5: Qux<'a, 'b, i32, 'c>,
@@ -114,7 +114,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Qux<'a, T>(&'a T);
| ^^^ --
-error[E0107]: this struct takes 0 lifetime arguments but 2 lifetime arguments were supplied
+error[E0107]: struct takes 0 lifetime arguments but 2 lifetime arguments were supplied
--> $DIR/E0107.rs:45:11
|
LL | quux: Quux<'a, i32, 'b>,
@@ -128,7 +128,7 @@ note: struct defined here, with 0 lifetime parameters
LL | struct Quux(T);
| ^^^^
-error[E0107]: this trait takes 0 generic arguments but 2 generic arguments were supplied
+error[E0107]: trait takes 0 generic arguments but 2 generic arguments were supplied
--> $DIR/E0107.rs:55:27
|
LL | fn trait_bound_generic>(_i: I) {
diff --git a/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed b/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed
index c50b9a12b6d44..a7a9db7d9775e 100644
--- a/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed
+++ b/tests/ui/expr/malformed_closure/missing_braces_around_block.fixed
@@ -4,16 +4,23 @@
// If this recovery happens, then plenty of errors are emitted. Here, we expect
// only one error.
//
-// This is part of issue #88065:
+// This is part of the following issues:
// https://github.com/rust-lang/rust/issues/88065
+// https://github.com/rust-lang/rust/issues/107959
// run-rustfix
fn main() {
+ // Closure with multiple expressions delimited by semicolon.
let num = 5;
(1..num).reduce(|a, b| {
//~^ ERROR: closure bodies that contain statements must be surrounded by braces
println!("{}", a);
a * b
}).unwrap();
+
+ // Closure with a single expression ended by a semicolon.
+ let mut v = vec![1, 2, 3];
+ v.iter_mut().for_each(|x| {*x = *x+1;});
+ //~^ ERROR: closure bodies that contain statements must be surrounded by braces
}
diff --git a/tests/ui/expr/malformed_closure/missing_braces_around_block.rs b/tests/ui/expr/malformed_closure/missing_braces_around_block.rs
index 58c81f3a6e2a9..b5690b2eca7c2 100644
--- a/tests/ui/expr/malformed_closure/missing_braces_around_block.rs
+++ b/tests/ui/expr/malformed_closure/missing_braces_around_block.rs
@@ -4,16 +4,23 @@
// If this recovery happens, then plenty of errors are emitted. Here, we expect
// only one error.
//
-// This is part of issue #88065:
+// This is part of the following issues:
// https://github.com/rust-lang/rust/issues/88065
+// https://github.com/rust-lang/rust/issues/107959
// run-rustfix
fn main() {
+ // Closure with multiple expressions delimited by semicolon.
let num = 5;
(1..num).reduce(|a, b|
//~^ ERROR: closure bodies that contain statements must be surrounded by braces
println!("{}", a);
a * b
).unwrap();
+
+ // Closure with a single expression ended by a semicolon.
+ let mut v = vec![1, 2, 3];
+ v.iter_mut().for_each(|x|*x = *x+1;);
+ //~^ ERROR: closure bodies that contain statements must be surrounded by braces
}
diff --git a/tests/ui/expr/malformed_closure/missing_braces_around_block.stderr b/tests/ui/expr/malformed_closure/missing_braces_around_block.stderr
index dac9a8cfc69d4..039eef909fc4b 100644
--- a/tests/ui/expr/malformed_closure/missing_braces_around_block.stderr
+++ b/tests/ui/expr/malformed_closure/missing_braces_around_block.stderr
@@ -1,5 +1,5 @@
error: closure bodies that contain statements must be surrounded by braces
- --> $DIR/missing_braces_around_block.rs:14:26
+ --> $DIR/missing_braces_around_block.rs:16:26
|
LL | (1..num).reduce(|a, b|
| ^
@@ -8,14 +8,14 @@ LL | ).unwrap();
| ^
|
note: statement found outside of a block
- --> $DIR/missing_braces_around_block.rs:16:26
+ --> $DIR/missing_braces_around_block.rs:18:26
|
LL | println!("{}", a);
| -----------------^ this `;` turns the preceding closure into a statement
| |
| this expression is a statement because of the trailing semicolon
note: the closure body may be incorrectly delimited
- --> $DIR/missing_braces_around_block.rs:14:21
+ --> $DIR/missing_braces_around_block.rs:16:21
|
LL | (1..num).reduce(|a, b|
| _____________________^
@@ -34,5 +34,30 @@ LL | a * b
LL ~ }).unwrap();
|
-error: aborting due to previous error
+error: closure bodies that contain statements must be surrounded by braces
+ --> $DIR/missing_braces_around_block.rs:24:29
+ |
+LL | v.iter_mut().for_each(|x|*x = *x+1;);
+ | ^ ^
+ |
+note: statement found outside of a block
+ --> $DIR/missing_braces_around_block.rs:24:39
+ |
+LL | v.iter_mut().for_each(|x|*x = *x+1;);
+ | ---------^ this `;` turns the preceding closure into a statement
+ | |
+ | this expression is a statement because of the trailing semicolon
+note: the closure body may be incorrectly delimited
+ --> $DIR/missing_braces_around_block.rs:24:27
+ |
+LL | v.iter_mut().for_each(|x|*x = *x+1;);
+ | ^^^^^^^^^^^^ - ...but likely you meant the closure to end here
+ | |
+ | this is the parsed closure...
+help: try adding braces
+ |
+LL | v.iter_mut().for_each(|x| {*x = *x+1;});
+ | + +
+
+error: aborting due to 2 previous errors
diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
index 9eb069637c685..5738dfa83eeab 100644
--- a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
+++ b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.rs
@@ -5,12 +5,12 @@ trait X {
fn foo<'a>(arg: Box>) {}
//~^ ERROR: lifetime in trait object type must be followed by `+`
//~| ERROR: parenthesized generic arguments cannot be used
- //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
- //~| ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
+ //~| ERROR associated type takes 0 generic arguments but 1 generic argument
+ //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments
fn bar<'a>(arg: Box>) {}
//~^ ERROR: parenthesized generic arguments cannot be used
- //~| ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
+ //~| ERROR associated type takes 1 lifetime argument but 0 lifetime arguments
fn main() {}
diff --git a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
index 165779796e0bc..461853379b562 100644
--- a/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
+++ b/tests/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr
@@ -23,7 +23,7 @@ LL | fn bar<'a>(arg: Box>) {}
| |
| help: remove these parentheses
-error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
LL | fn foo<'a>(arg: Box>) {}
@@ -39,7 +39,7 @@ help: add missing lifetime argument
LL | fn foo<'a>(arg: Box>) {}
| +++
-error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/gat-trait-path-parenthesised-args.rs:5:27
|
LL | fn foo<'a>(arg: Box>) {}
@@ -53,7 +53,7 @@ note: associated type defined here, with 0 generic parameters
LL | type Y<'a>;
| ^
-error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/gat-trait-path-parenthesised-args.rs:12:27
|
LL | fn bar<'a>(arg: Box>) {}
diff --git a/tests/ui/generic-associated-types/missing_lifetime_args.rs b/tests/ui/generic-associated-types/missing_lifetime_args.rs
index 78def80925ad0..331511ba61a48 100644
--- a/tests/ui/generic-associated-types/missing_lifetime_args.rs
+++ b/tests/ui/generic-associated-types/missing_lifetime_args.rs
@@ -12,9 +12,9 @@ fn foo<'c, 'd>(_arg: Box>) {}
//~^ ERROR missing generics for associated type
fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b>) {}
-//~^ ERROR this struct takes 3 lifetime arguments but 2 lifetime
+//~^ ERROR struct takes 3 lifetime arguments but 2 lifetime
fn f<'a>(_arg: Foo<'a>) {}
-//~^ ERROR this struct takes 3 lifetime arguments but 1 lifetime
+//~^ ERROR struct takes 3 lifetime arguments but 1 lifetime
fn main() {}
diff --git a/tests/ui/generic-associated-types/missing_lifetime_args.stderr b/tests/ui/generic-associated-types/missing_lifetime_args.stderr
index 8f74b12c008e6..1a7a2e787a1a9 100644
--- a/tests/ui/generic-associated-types/missing_lifetime_args.stderr
+++ b/tests/ui/generic-associated-types/missing_lifetime_args.stderr
@@ -14,7 +14,7 @@ help: add missing lifetime arguments
LL | fn foo<'c, 'd>(_arg: Box = (&'c u32, &'d u32)>>) {}
| ++++++++
-error[E0107]: this struct takes 3 lifetime arguments but 2 lifetime arguments were supplied
+error[E0107]: struct takes 3 lifetime arguments but 2 lifetime arguments were supplied
--> $DIR/missing_lifetime_args.rs:14:26
|
LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b>) {}
@@ -32,7 +32,7 @@ help: add missing lifetime argument
LL | fn bar<'a, 'b, 'c>(_arg: Foo<'a, 'b, 'a>) {}
| ++++
-error[E0107]: this struct takes 3 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 3 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/missing_lifetime_args.rs:17:16
|
LL | fn f<'a>(_arg: Foo<'a>) {}
diff --git a/tests/ui/generic-associated-types/missing_lifetime_const.rs b/tests/ui/generic-associated-types/missing_lifetime_const.rs
index 8b174b9e971e0..6e395dfdec1fa 100644
--- a/tests/ui/generic-associated-types/missing_lifetime_const.rs
+++ b/tests/ui/generic-associated-types/missing_lifetime_const.rs
@@ -4,7 +4,7 @@ trait Foo {
fn foo() {
let _: ::Assoc<3>;
- //~^ ERROR this associated type
+ //~^ ERROR associated type
}
fn main() {}
diff --git a/tests/ui/generic-associated-types/missing_lifetime_const.stderr b/tests/ui/generic-associated-types/missing_lifetime_const.stderr
index 62d2e9f49dde1..41945aabfb58c 100644
--- a/tests/ui/generic-associated-types/missing_lifetime_const.stderr
+++ b/tests/ui/generic-associated-types/missing_lifetime_const.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/missing_lifetime_const.rs:6:24
|
LL | let _: ::Assoc<3>;
diff --git a/tests/ui/generic-associated-types/parameter_number_and_kind.rs b/tests/ui/generic-associated-types/parameter_number_and_kind.rs
index 8428e7763fb46..ae2f7c00ea419 100644
--- a/tests/ui/generic-associated-types/parameter_number_and_kind.rs
+++ b/tests/ui/generic-associated-types/parameter_number_and_kind.rs
@@ -9,10 +9,10 @@ trait Foo {
// Test parameters in default values
type FOk = Self::E<'static, T>;
type FErr1 = Self::E<'static, 'static>;
- //~^ ERROR this associated type takes 1 lifetime argument but 2 lifetime arguments were supplied
- //~| ERROR this associated type takes 1
+ //~^ ERROR associated type takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~| ERROR associated type takes 1
type FErr2 = Self::E<'static, T, u32>;
- //~^ ERROR this associated type takes 1
+ //~^ ERROR associated type takes 1
}
fn main() {}
diff --git a/tests/ui/generic-associated-types/parameter_number_and_kind.stderr b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr
index c20b9669e8140..4523044b5886b 100644
--- a/tests/ui/generic-associated-types/parameter_number_and_kind.stderr
+++ b/tests/ui/generic-associated-types/parameter_number_and_kind.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated type takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: associated type takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/parameter_number_and_kind.rs:11:24
|
LL | type FErr1 = Self::E<'static, 'static>;
@@ -12,7 +12,7 @@ note: associated type defined here, with 1 lifetime parameter: `'a`
LL | type E<'a, T>;
| ^ --
-error[E0107]: this associated type takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: associated type takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/parameter_number_and_kind.rs:11:24
|
LL | type FErr1 = Self::E<'static, 'static>;
@@ -28,7 +28,7 @@ help: add missing generic argument
LL | type FErr1 = Self::E<'static, 'static, T>;
| +++
-error[E0107]: this associated type takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: associated type takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/parameter_number_and_kind.rs:14:27
|
LL | type FErr2 = Self::E<'static, T, u32>;
diff --git a/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs b/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
index 1622b92aa0cc2..c58f9cf1dfc8e 100644
--- a/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
+++ b/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.rs
@@ -4,8 +4,8 @@ trait X {
const _: () = {
fn f2<'a>(arg : Box = &'a ()>>) {}
- //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments
- //~| ERROR this associated type takes 0 generic arguments but 1 generic argument
+ //~^ ERROR associated type takes 1 lifetime argument but 0 lifetime arguments
+ //~| ERROR associated type takes 0 generic arguments but 1 generic argument
};
fn main() {}
diff --git a/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr b/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
index 0a09ec5dc4935..fab5b474d9283 100644
--- a/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
+++ b/tests/ui/generic-associated-types/parse/trait-path-type-error-once-implemented.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/trait-path-type-error-once-implemented.rs:6:29
|
LL | fn f2<'a>(arg : Box = &'a ()>>) {}
@@ -14,7 +14,7 @@ help: add missing lifetime argument
LL | fn f2<'a>(arg : Box = &'a ()>>) {}
| +++
-error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/trait-path-type-error-once-implemented.rs:6:29
|
LL | fn f2<'a>(arg : Box = &'a ()>>) {}
diff --git a/tests/ui/generics/bad-mid-path-type-params.rs b/tests/ui/generics/bad-mid-path-type-params.rs
index 23a5d1525d995..37d484cba0bd7 100644
--- a/tests/ui/generics/bad-mid-path-type-params.rs
+++ b/tests/ui/generics/bad-mid-path-type-params.rs
@@ -28,17 +28,17 @@ impl Trait for S2 {
fn foo<'a>() {
let _ = S::new::(1, 1.0);
- //~^ ERROR this associated function takes 1
+ //~^ ERROR associated function takes 1
let _ = S::<'a,isize>::new::(1, 1.0);
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied
let _: S2 = Trait::new::(1, 1.0);
- //~^ ERROR this associated function takes 1
+ //~^ ERROR associated function takes 1
let _: S2 = Trait::<'a,isize>::new::(1, 1.0);
- //~^ ERROR this trait takes 0 lifetime arguments but 1 lifetime argument was supplied
- //~| ERROR this associated function takes 1
+ //~^ ERROR trait takes 0 lifetime arguments but 1 lifetime argument was supplied
+ //~| ERROR associated function takes 1
}
fn main() {}
diff --git a/tests/ui/generics/bad-mid-path-type-params.stderr b/tests/ui/generics/bad-mid-path-type-params.stderr
index aee2b60159f10..71e15dd4c9264 100644
--- a/tests/ui/generics/bad-mid-path-type-params.stderr
+++ b/tests/ui/generics/bad-mid-path-type-params.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated function takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: associated function takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/bad-mid-path-type-params.rs:30:16
|
LL | let _ = S::new::(1, 1.0);
@@ -12,7 +12,7 @@ note: associated function defined here, with 1 generic parameter: `U`
LL | fn new(x: T, _: U) -> S {
| ^^^ -
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/bad-mid-path-type-params.rs:33:13
|
LL | let _ = S::<'a,isize>::new::(1, 1.0);
@@ -26,7 +26,7 @@ note: struct defined here, with 0 lifetime parameters
LL | struct S {
| ^
-error[E0107]: this associated function takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: associated function takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/bad-mid-path-type-params.rs:36:24
|
LL | let _: S2 = Trait::new::(1, 1.0);
@@ -40,7 +40,7 @@ note: associated function defined here, with 1 generic parameter: `U`
LL | fn new(x: T, y: U) -> Self;
| ^^^ -
-error[E0107]: this trait takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/bad-mid-path-type-params.rs:39:17
|
LL | let _: S2 = Trait::<'a,isize>::new::(1, 1.0);
@@ -54,7 +54,7 @@ note: trait defined here, with 0 lifetime parameters
LL | trait Trait {
| ^^^^^
-error[E0107]: this associated function takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: associated function takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/bad-mid-path-type-params.rs:39:36
|
LL | let _: S2 = Trait::<'a,isize>::new::(1, 1.0);
diff --git a/tests/ui/generics/generic-arg-mismatch-recover.rs b/tests/ui/generics/generic-arg-mismatch-recover.rs
index 2cf7f1d657b18..947f33414dbb9 100644
--- a/tests/ui/generics/generic-arg-mismatch-recover.rs
+++ b/tests/ui/generics/generic-arg-mismatch-recover.rs
@@ -4,9 +4,9 @@ struct Bar<'a>(&'a ());
fn main() {
Foo::<'static, 'static, ()>(&0);
- //~^ ERROR this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~^ ERROR struct takes 1 lifetime argument but 2 lifetime arguments were supplied
Bar::<'static, 'static, ()>(&());
- //~^ ERROR this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
- //~| ERROR this struct takes 0
+ //~^ ERROR struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~| ERROR struct takes 0
}
diff --git a/tests/ui/generics/generic-arg-mismatch-recover.stderr b/tests/ui/generics/generic-arg-mismatch-recover.stderr
index 45fea925f27cf..f549a7180fc66 100644
--- a/tests/ui/generics/generic-arg-mismatch-recover.stderr
+++ b/tests/ui/generics/generic-arg-mismatch-recover.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/generic-arg-mismatch-recover.rs:6:5
|
LL | Foo::<'static, 'static, ()>(&0);
@@ -12,7 +12,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Foo<'a, T: 'a>(&'a T);
| ^^^ --
-error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/generic-arg-mismatch-recover.rs:9:5
|
LL | Bar::<'static, 'static, ()>(&());
@@ -26,7 +26,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Bar<'a>(&'a ());
| ^^^ --
-error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/generic-arg-mismatch-recover.rs:9:5
|
LL | Bar::<'static, 'static, ()>(&());
diff --git a/tests/ui/generics/generic-impl-less-params-with-defaults.rs b/tests/ui/generics/generic-impl-less-params-with-defaults.rs
index 66afbb58ad490..6c00411561e32 100644
--- a/tests/ui/generics/generic-impl-less-params-with-defaults.rs
+++ b/tests/ui/generics/generic-impl-less-params-with-defaults.rs
@@ -9,5 +9,5 @@ impl Foo {
fn main() {
Foo::::new();
- //~^ ERROR this struct takes at least 2 generic arguments but 1 generic argument
+ //~^ ERROR struct takes at least 2 generic arguments but 1 generic argument
}
diff --git a/tests/ui/generics/generic-impl-less-params-with-defaults.stderr b/tests/ui/generics/generic-impl-less-params-with-defaults.stderr
index cdbb57902e4a7..262561fa81e6c 100644
--- a/tests/ui/generics/generic-impl-less-params-with-defaults.stderr
+++ b/tests/ui/generics/generic-impl-less-params-with-defaults.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes at least 2 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes at least 2 generic arguments but 1 generic argument was supplied
--> $DIR/generic-impl-less-params-with-defaults.rs:11:5
|
LL | Foo::::new();
diff --git a/tests/ui/generics/generic-impl-more-params-with-defaults.rs b/tests/ui/generics/generic-impl-more-params-with-defaults.rs
index a283323742a0f..be633ec464f8b 100644
--- a/tests/ui/generics/generic-impl-more-params-with-defaults.rs
+++ b/tests/ui/generics/generic-impl-more-params-with-defaults.rs
@@ -11,5 +11,5 @@ impl Vec {
fn main() {
Vec::::new();
- //~^ ERROR this struct takes at most 2 generic arguments but 3 generic arguments were supplied
+ //~^ ERROR struct takes at most 2 generic arguments but 3 generic arguments were supplied
}
diff --git a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr
index fe9b670da799c..2f4682c4e5a97 100644
--- a/tests/ui/generics/generic-impl-more-params-with-defaults.stderr
+++ b/tests/ui/generics/generic-impl-more-params-with-defaults.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes at most 2 generic arguments but 3 generic arguments were supplied
+error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments were supplied
--> $DIR/generic-impl-more-params-with-defaults.rs:13:5
|
LL | Vec::::new();
diff --git a/tests/ui/generics/generic-type-more-params-with-defaults.rs b/tests/ui/generics/generic-type-more-params-with-defaults.rs
index 3dab03297c9df..b83fdb5c455a7 100644
--- a/tests/ui/generics/generic-type-more-params-with-defaults.rs
+++ b/tests/ui/generics/generic-type-more-params-with-defaults.rs
@@ -7,5 +7,5 @@ struct Vec(
fn main() {
let _: Vec;
- //~^ ERROR this struct takes at most 2 generic arguments but 3 generic arguments
+ //~^ ERROR struct takes at most 2 generic arguments but 3 generic arguments
}
diff --git a/tests/ui/generics/generic-type-more-params-with-defaults.stderr b/tests/ui/generics/generic-type-more-params-with-defaults.stderr
index 7f0198f0e8424..4d01ba1f453d8 100644
--- a/tests/ui/generics/generic-type-more-params-with-defaults.stderr
+++ b/tests/ui/generics/generic-type-more-params-with-defaults.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes at most 2 generic arguments but 3 generic arguments were supplied
+error[E0107]: struct takes at most 2 generic arguments but 3 generic arguments were supplied
--> $DIR/generic-type-more-params-with-defaults.rs:9:12
|
LL | let _: Vec;
diff --git a/tests/ui/generics/wrong-number-of-args.rs b/tests/ui/generics/wrong-number-of-args.rs
index cd2f96a1819e4..e4eaff21af1da 100644
--- a/tests/ui/generics/wrong-number-of-args.rs
+++ b/tests/ui/generics/wrong-number-of-args.rs
@@ -4,18 +4,18 @@ mod no_generics {
type A = Ty;
type B = Ty<'static>;
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
//~| HELP remove these generics
type C = Ty<'static, usize>;
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument
- //~| ERROR this struct takes 0 generic arguments but 1 generic argument
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
+ //~| ERROR struct takes 0 generic arguments but 1 generic argument
//~| HELP remove this lifetime argument
//~| HELP remove this generic argument
type D = Ty<'static, usize, { 0 }>;
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument
- //~| ERROR this struct takes 0 generic arguments but 2 generic arguments
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
+ //~| ERROR struct takes 0 generic arguments but 2 generic arguments
//~| HELP remove this lifetime argument
//~| HELP remove these generic arguments
}
@@ -28,17 +28,17 @@ mod type_and_type {
//~| HELP add missing
type B = Ty;
- //~^ ERROR this struct takes 2 generic arguments but 1 generic argument
+ //~^ ERROR struct takes 2 generic arguments but 1 generic argument
//~| HELP add missing
type C = Ty;
type D = Ty;
- //~^ ERROR this struct takes 2 generic arguments but 3 generic arguments
+ //~^ ERROR struct takes 2 generic arguments but 3 generic arguments
//~| HELP remove this
type E = Ty<>;
- //~^ ERROR this struct takes 2 generic arguments but 0 generic arguments were supplied
+ //~^ ERROR struct takes 2 generic arguments but 0 generic arguments were supplied
//~| HELP add missing
}
@@ -52,7 +52,7 @@ mod lifetime_and_type {
//~| HELP consider introducing
type B = Ty<'static>;
- //~^ ERROR this struct takes 1 generic argument but 0 generic arguments
+ //~^ ERROR struct takes 1 generic argument but 0 generic arguments
//~| HELP add missing
type C = Ty;
@@ -62,14 +62,14 @@ mod lifetime_and_type {
type D = Ty<'static, usize>;
type E = Ty<>;
- //~^ ERROR this struct takes 1 generic argument but 0 generic arguments
+ //~^ ERROR struct takes 1 generic argument but 0 generic arguments
//~| ERROR missing lifetime specifier
//~| HELP consider introducing
//~| HELP add missing
type F = Ty<'static, usize, 'static, usize>;
- //~^ ERROR this struct takes 1 lifetime argument but 2 lifetime arguments
- //~| ERROR this struct takes 1 generic argument but 2 generic arguments
+ //~^ ERROR struct takes 1 lifetime argument but 2 lifetime arguments
+ //~| ERROR struct takes 1 generic argument but 2 generic arguments
//~| HELP remove this lifetime argument
//~| HELP remove this generic argument
}
@@ -82,7 +82,7 @@ mod type_and_type_and_type {
//~| HELP add missing
type B = Ty;
- //~^ ERROR this struct takes at least 2
+ //~^ ERROR struct takes at least 2
//~| HELP add missing
type C = Ty;
@@ -90,11 +90,11 @@ mod type_and_type_and_type {
type D = Ty;
type E = Ty;
- //~^ ERROR this struct takes at most 3
+ //~^ ERROR struct takes at most 3
//~| HELP remove
type F = Ty<>;
- //~^ ERROR this struct takes at least 2 generic arguments but 0 generic arguments
+ //~^ ERROR struct takes at least 2 generic arguments but 0 generic arguments
//~| HELP add missing
}
@@ -114,7 +114,7 @@ mod r#trait {
}
type A = Box>;
- //~^ ERROR this trait takes 0 generic arguments but 1 generic argument
+ //~^ ERROR trait takes 0 generic arguments but 1 generic argument
//~| HELP remove
type B = Box;
@@ -123,7 +123,7 @@ mod r#trait {
//~| HELP consider making the bound lifetime-generic
type C = Box>;
- //~^ ERROR this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~^ ERROR trait takes 1 lifetime argument but 2 lifetime arguments were supplied
//~| HELP remove
type D = Box;
@@ -131,7 +131,7 @@ mod r#trait {
//~| HELP add missing
type E = Box>;
- //~^ ERROR this trait takes 1 generic argument but 2 generic arguments
+ //~^ ERROR trait takes 1 generic argument but 2 generic arguments
//~| HELP remove
type F = Box>;
@@ -140,7 +140,7 @@ mod r#trait {
//~| HELP consider making the bound lifetime-generic
type G = Box>;
- //~^ ERROR this trait takes 1 generic argument but 0 generic arguments
+ //~^ ERROR trait takes 1 generic argument but 0 generic arguments
//~| HELP add missing
}
@@ -151,7 +151,7 @@ mod associated_item {
}
type A = Box>;
- //~^ ERROR this trait takes 0 generic arguments but 1 generic argument
+ //~^ ERROR trait takes 0 generic arguments but 1 generic argument
//~| HELP remove
}
@@ -166,14 +166,14 @@ mod associated_item {
//~| HELP consider making the bound lifetime-generic
type B = Box>;
- //~^ ERROR this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~^ ERROR trait takes 1 lifetime argument but 2 lifetime arguments were supplied
//~| HELP remove
type C = Box>;
//~^ ERROR missing lifetime specifier
//~| HELP consider introducing
//~| HELP consider making the bound lifetime-generic
- //~| ERROR this trait takes 0 generic arguments but 1 generic argument
+ //~| ERROR trait takes 0 generic arguments but 1 generic argument
//~| HELP remove
}
@@ -183,17 +183,17 @@ mod associated_item {
}
type A = Box>;
- //~^ ERROR this trait takes 1 generic argument but 0 generic arguments
+ //~^ ERROR trait takes 1 generic argument but 0 generic arguments
//~| HELP add missing
type B = Box>;
- //~^ ERROR this trait takes 1 generic argument but 2 generic arguments
+ //~^ ERROR trait takes 1 generic argument but 2 generic arguments
//~| HELP remove
type C = Box>;
- //~^ ERROR this trait takes 1 generic argument but 0 generic arguments
+ //~^ ERROR trait takes 1 generic argument but 0 generic arguments
//~| HELP add missing
- //~| ERROR this trait takes 0 lifetime arguments but 1 lifetime argument was supplied
+ //~| ERROR trait takes 0 lifetime arguments but 1 lifetime argument was supplied
//~| HELP remove
}
@@ -203,20 +203,20 @@ mod associated_item {
}
type A = Box>;
- //~^ ERROR this trait takes 1 generic argument but 0 generic arguments
+ //~^ ERROR trait takes 1 generic argument but 0 generic arguments
//~| HELP add missing
//~| ERROR missing lifetime specifier
//~| HELP consider introducing
//~| HELP consider making the bound lifetime-generic
type B = Box>;
- //~^ ERROR this trait takes 1 generic argument but 0 generic arguments were supplied
+ //~^ ERROR trait takes 1 generic argument but 0 generic arguments were supplied
//~| HELP add missing
type C = Box>;
- //~^ ERROR this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~^ ERROR trait takes 1 lifetime argument but 2 lifetime arguments were supplied
//~| HELP remove
- //~| ERROR this trait takes 1 generic argument but 0 generic arguments
+ //~| ERROR trait takes 1 generic argument but 0 generic arguments
//~| HELP add missing
type D = Box>;
@@ -228,21 +228,21 @@ mod associated_item {
//~^ ERROR missing lifetime specifier
//~| HELP consider introducing
//~| HELP consider making the bound lifetime-generic
- //~| ERROR this trait takes 1 generic argument but 2 generic arguments
+ //~| ERROR trait takes 1 generic argument but 2 generic arguments
//~| HELP remove
type F = Box>;
- //~^ ERROR this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~^ ERROR trait takes 1 lifetime argument but 2 lifetime arguments were supplied
//~| HELP remove
type G = Box>;
- //~^ ERROR this trait takes 1 generic argument but 2 generic arguments
+ //~^ ERROR trait takes 1 generic argument but 2 generic arguments
//~| HELP remove
type H = Box>;
- //~^ ERROR this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+ //~^ ERROR trait takes 1 lifetime argument but 2 lifetime arguments were supplied
//~| HELP remove
- //~| ERROR this trait takes 1 generic argument but 2 generic arguments
+ //~| ERROR trait takes 1 generic argument but 2 generic arguments
//~| HELP remove
}
@@ -252,15 +252,15 @@ mod associated_item {
}
type A = Box>;
- //~^ ERROR this trait takes 2 generic arguments but 0 generic arguments
+ //~^ ERROR trait takes 2 generic arguments but 0 generic arguments
//~| HELP add missing
type B = Box>;
- //~^ ERROR this trait takes 2 generic arguments but 1 generic argument
+ //~^ ERROR trait takes 2 generic arguments but 1 generic argument
//~| HELP add missing
type C = Box>;
- //~^ ERROR this trait takes 2 generic arguments but 3 generic arguments
+ //~^ ERROR trait takes 2 generic arguments but 3 generic arguments
//~| HELP remove
}
@@ -275,7 +275,7 @@ mod associated_item {
//~| HELP consider making the bound lifetime-generic
type B = Box>;
- //~^ ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
+ //~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
//~| HELP add missing lifetime argument
}
@@ -288,17 +288,17 @@ mod associated_item {
//~^ ERROR missing lifetime specifier
//~| HELP consider introducing
//~| HELP consider making the bound lifetime-generic
- //~| ERROR this trait takes 1 generic argument but 0 generic arguments
+ //~| ERROR trait takes 1 generic argument but 0 generic arguments
//~| HELP add missing
type B = Box>;
- //~^ ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
+ //~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
//~| HELP add missing lifetime argument
- //~| ERROR this trait takes 1 generic argument but 0 generic arguments
+ //~| ERROR trait takes 1 generic argument but 0 generic arguments
//~| HELP add missing
type C = Box>;
- //~^ ERROR this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
+ //~^ ERROR trait takes 2 lifetime arguments but 1 lifetime argument was supplied
//~| HELP add missing lifetime argument
}
}
@@ -312,21 +312,21 @@ mod stdlib {
//~| HELP add missing
type B = HashMap;
- //~^ ERROR this struct takes at least
+ //~^ ERROR struct takes at least
//~| HELP add missing
type C = HashMap<'static>;
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument
//~| HELP remove these generics
- //~| ERROR this struct takes at least 2
+ //~| ERROR struct takes at least 2
//~| HELP add missing
type D = HashMap;
- //~^ ERROR this struct takes at most 3
+ //~^ ERROR struct takes at most 3
//~| HELP remove this
type E = HashMap<>;
- //~^ ERROR this struct takes at least 2 generic arguments but 0 generic arguments
+ //~^ ERROR struct takes at least 2 generic arguments but 0 generic arguments
//~| HELP add missing
}
@@ -336,21 +336,21 @@ mod stdlib {
//~| HELP add missing
type B = Result;
- //~^ ERROR this enum takes 2 generic arguments but 1 generic argument
+ //~^ ERROR enum takes 2 generic arguments but 1 generic argument
//~| HELP add missing
type C = Result<'static>;
- //~^ ERROR this enum takes 0 lifetime arguments but 1 lifetime argument
+ //~^ ERROR enum takes 0 lifetime arguments but 1 lifetime argument
//~| HELP remove these generics
- //~| ERROR this enum takes 2 generic arguments but 0 generic arguments
+ //~| ERROR enum takes 2 generic arguments but 0 generic arguments
//~| HELP add missing
type D = Result;
- //~^ ERROR this enum takes 2 generic arguments but 3 generic arguments
+ //~^ ERROR enum takes 2 generic arguments but 3 generic arguments
//~| HELP remove
type E = Result<>;
- //~^ ERROR this enum takes 2 generic arguments but 0 generic arguments
+ //~^ ERROR enum takes 2 generic arguments but 0 generic arguments
//~| HELP add missing
}
}
diff --git a/tests/ui/generics/wrong-number-of-args.stderr b/tests/ui/generics/wrong-number-of-args.stderr
index 75e33f680eadb..9006fb10b67fa 100644
--- a/tests/ui/generics/wrong-number-of-args.stderr
+++ b/tests/ui/generics/wrong-number-of-args.stderr
@@ -167,7 +167,7 @@ help: consider introducing a named lifetime parameter
LL | type A<'a> = Box>;
| ++++ +++++++
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:6:14
|
LL | type B = Ty<'static>;
@@ -181,7 +181,7 @@ note: struct defined here, with 0 lifetime parameters
LL | struct Ty;
| ^^
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:10:14
|
LL | type C = Ty<'static, usize>;
@@ -195,7 +195,7 @@ note: struct defined here, with 0 lifetime parameters
LL | struct Ty;
| ^^
-error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:10:14
|
LL | type C = Ty<'static, usize>;
@@ -209,7 +209,7 @@ note: struct defined here, with 0 generic parameters
LL | struct Ty;
| ^^
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:16:14
|
LL | type D = Ty<'static, usize, { 0 }>;
@@ -223,7 +223,7 @@ note: struct defined here, with 0 lifetime parameters
LL | struct Ty;
| ^^
-error[E0107]: this struct takes 0 generic arguments but 2 generic arguments were supplied
+error[E0107]: struct takes 0 generic arguments but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:16:14
|
LL | type D = Ty<'static, usize, { 0 }>;
@@ -253,7 +253,7 @@ help: add missing generic arguments
LL | type A = Ty;
| ++++++
-error[E0107]: this struct takes 2 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:30:14
|
LL | type B = Ty;
@@ -271,7 +271,7 @@ help: add missing generic argument
LL | type B = Ty;
| +++
-error[E0107]: this struct takes 2 generic arguments but 3 generic arguments were supplied
+error[E0107]: struct takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:36:14
|
LL | type D = Ty;
@@ -285,7 +285,7 @@ note: struct defined here, with 2 generic parameters: `A`, `B`
LL | struct Ty;
| ^^ - -
-error[E0107]: this struct takes 2 generic arguments but 0 generic arguments were supplied
+error[E0107]: struct takes 2 generic arguments but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:40:14
|
LL | type E = Ty<>;
@@ -317,7 +317,7 @@ help: add missing generic argument
LL | type A = Ty;
| +++
-error[E0107]: this struct takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:54:14
|
LL | type B = Ty<'static>;
@@ -333,7 +333,7 @@ help: add missing generic argument
LL | type B = Ty<'static, T>;
| +++
-error[E0107]: this struct takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: struct takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:64:14
|
LL | type E = Ty<>;
@@ -349,7 +349,7 @@ help: add missing generic argument
LL | type E = Ty;
| +
-error[E0107]: this struct takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: struct takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:70:14
|
LL | type F = Ty<'static, usize, 'static, usize>;
@@ -363,7 +363,7 @@ note: struct defined here, with 1 lifetime parameter: `'a`
LL | struct Ty<'a, T>;
| ^^ --
-error[E0107]: this struct takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: struct takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:70:14
|
LL | type F = Ty<'static, usize, 'static, usize>;
@@ -393,7 +393,7 @@ help: add missing generic arguments
LL | type A = Ty;
| ++++++
-error[E0107]: this struct takes at least 2 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes at least 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:84:14
|
LL | type B = Ty;
@@ -411,7 +411,7 @@ help: add missing generic argument
LL | type B = Ty;
| +++
-error[E0107]: this struct takes at most 3 generic arguments but 4 generic arguments were supplied
+error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:92:14
|
LL | type E = Ty;
@@ -425,7 +425,7 @@ note: struct defined here, with at most 3 generic parameters: `A`, `B`, `C`
LL | struct Ty;
| ^^ - - ----------------
-error[E0107]: this struct takes at least 2 generic arguments but 0 generic arguments were supplied
+error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:96:14
|
LL | type F = Ty<>;
@@ -441,7 +441,7 @@ help: add missing generic arguments
LL | type F = Ty;
| ++++
-error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:116:22
|
LL | type A = Box>;
@@ -455,7 +455,7 @@ note: trait defined here, with 0 generic parameters
LL | trait NonGeneric {
| ^^^^^^^^^^
-error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:125:22
|
LL | type C = Box>;
@@ -485,7 +485,7 @@ help: add missing generic argument
LL | type D = Box>;
| +++
-error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:133:22
|
LL | type E = Box>;
@@ -499,7 +499,7 @@ note: trait defined here, with 1 generic parameter: `A`
LL | trait GenericType {
| ^^^^^^^^^^^ -
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:142:22
|
LL | type G = Box>;
@@ -515,7 +515,7 @@ help: add missing generic argument
LL | type G = Box>;
| +
-error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:153:26
|
LL | type A = Box>;
@@ -529,7 +529,7 @@ note: trait defined here, with 0 generic parameters
LL | trait NonGenericAT {
| ^^^^^^^^^^^^
-error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:168:26
|
LL | type B = Box>;
@@ -543,7 +543,7 @@ note: trait defined here, with 1 lifetime parameter: `'a`
LL | trait GenericLifetimeAT<'a> {
| ^^^^^^^^^^^^^^^^^ --
-error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:172:26
|
LL | type C = Box>;
@@ -557,7 +557,7 @@ note: trait defined here, with 0 generic parameters
LL | trait GenericLifetimeAT<'a> {
| ^^^^^^^^^^^^^^^^^
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:185:26
|
LL | type A = Box>;
@@ -573,7 +573,7 @@ help: add missing generic argument
LL | type A = Box>;
| ++
-error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:189:26
|
LL | type B = Box>;
@@ -587,7 +587,7 @@ note: trait defined here, with 1 generic parameter: `A`
LL | trait GenericTypeAT {
| ^^^^^^^^^^^^^ -
-error[E0107]: this trait takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: trait takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:193:26
|
LL | type C = Box>;
@@ -601,7 +601,7 @@ note: trait defined here, with 0 lifetime parameters
LL | trait GenericTypeAT {
| ^^^^^^^^^^^^^
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:193:26
|
LL | type C = Box>;
@@ -617,7 +617,7 @@ help: add missing generic argument
LL | type C = Box>;
| +++
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:205:26
|
LL | type A = Box>;
@@ -633,7 +633,7 @@ help: add missing generic argument
LL | type A = Box>;
| ++
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:212:26
|
LL | type B = Box>;
@@ -649,7 +649,7 @@ help: add missing generic argument
LL | type B = Box>;
| +++
-error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:216:26
|
LL | type C = Box>;
@@ -663,7 +663,7 @@ note: trait defined here, with 1 lifetime parameter: `'a`
LL | trait GenericLifetimeTypeAT<'a, A> {
| ^^^^^^^^^^^^^^^^^^^^^ --
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:216:26
|
LL | type C = Box>;
@@ -679,7 +679,7 @@ help: add missing generic argument
LL | type C = Box>;
| +++
-error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:227:26
|
LL | type E = Box>;
@@ -693,7 +693,7 @@ note: trait defined here, with 1 generic parameter: `A`
LL | trait GenericLifetimeTypeAT<'a, A> {
| ^^^^^^^^^^^^^^^^^^^^^ -
-error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:234:26
|
LL | type F = Box>;
@@ -707,7 +707,7 @@ note: trait defined here, with 1 lifetime parameter: `'a`
LL | trait GenericLifetimeTypeAT<'a, A> {
| ^^^^^^^^^^^^^^^^^^^^^ --
-error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:238:26
|
LL | type G = Box>;
@@ -721,7 +721,7 @@ note: trait defined here, with 1 generic parameter: `A`
LL | trait GenericLifetimeTypeAT<'a, A> {
| ^^^^^^^^^^^^^^^^^^^^^ -
-error[E0107]: this trait takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: trait takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/wrong-number-of-args.rs:242:26
|
LL | type H = Box>;
@@ -735,7 +735,7 @@ note: trait defined here, with 1 lifetime parameter: `'a`
LL | trait GenericLifetimeTypeAT<'a, A> {
| ^^^^^^^^^^^^^^^^^^^^^ --
-error[E0107]: this trait takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:242:26
|
LL | type H = Box>;
@@ -749,7 +749,7 @@ note: trait defined here, with 1 generic parameter: `A`
LL | trait GenericLifetimeTypeAT<'a, A> {
| ^^^^^^^^^^^^^^^^^^^^^ -
-error[E0107]: this trait takes 2 generic arguments but 0 generic arguments were supplied
+error[E0107]: trait takes 2 generic arguments but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:254:26
|
LL | type A = Box>;
@@ -765,7 +765,7 @@ help: add missing generic arguments
LL | type A = Box>;
| +++++
-error[E0107]: this trait takes 2 generic arguments but 1 generic argument was supplied
+error[E0107]: trait takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:258:26
|
LL | type B = Box>;
@@ -783,7 +783,7 @@ help: add missing generic argument
LL | type B = Box>;
| +++
-error[E0107]: this trait takes 2 generic arguments but 3 generic arguments were supplied
+error[E0107]: trait takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:262:26
|
LL | type C = Box>;
@@ -797,7 +797,7 @@ note: trait defined here, with 2 generic parameters: `A`, `B`
LL | trait GenericTypeTypeAT {
| ^^^^^^^^^^^^^^^^^ - -
-error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:277:26
|
LL | type B = Box>;
@@ -815,7 +815,7 @@ help: add missing lifetime argument
LL | type B = Box>;
| +++++++++
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:287:26
|
LL | type A = Box>;
@@ -831,7 +831,7 @@ help: add missing generic argument
LL | type A = Box>;
| ++
-error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:294:26
|
LL | type B = Box>;
@@ -849,7 +849,7 @@ help: add missing lifetime argument
LL | type B = Box>;
| +++++++++
-error[E0107]: this trait takes 1 generic argument but 0 generic arguments were supplied
+error[E0107]: trait takes 1 generic argument but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:294:26
|
LL | type B = Box>;
@@ -865,7 +865,7 @@ help: add missing generic argument
LL | type B = Box>;
| +++
-error[E0107]: this trait takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: trait takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:300:26
|
LL | type C = Box>;
@@ -894,7 +894,7 @@ help: add missing generic arguments
LL | type A = HashMap;
| ++++++
-error[E0107]: this struct takes at least 2 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes at least 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:314:18
|
LL | type B = HashMap;
@@ -907,7 +907,7 @@ help: add missing generic argument
LL | type B = HashMap;
| +++
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:318:18
|
LL | type C = HashMap<'static>;
@@ -915,7 +915,7 @@ LL | type C = HashMap<'static>;
| |
| expected 0 lifetime arguments
-error[E0107]: this struct takes at least 2 generic arguments but 0 generic arguments were supplied
+error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:318:18
|
LL | type C = HashMap<'static>;
@@ -926,7 +926,7 @@ help: add missing generic arguments
LL | type C = HashMap<'static, K, V>;
| ++++++
-error[E0107]: this struct takes at most 3 generic arguments but 4 generic arguments were supplied
+error[E0107]: struct takes at most 3 generic arguments but 4 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:324:18
|
LL | type D = HashMap;
@@ -934,7 +934,7 @@ LL | type D = HashMap;
| |
| expected at most 3 generic arguments
-error[E0107]: this struct takes at least 2 generic arguments but 0 generic arguments were supplied
+error[E0107]: struct takes at least 2 generic arguments but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:328:18
|
LL | type E = HashMap<>;
@@ -956,7 +956,7 @@ help: add missing generic arguments
LL | type A = Result;
| ++++++
-error[E0107]: this enum takes 2 generic arguments but 1 generic argument was supplied
+error[E0107]: enum takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/wrong-number-of-args.rs:338:18
|
LL | type B = Result;
@@ -969,7 +969,7 @@ help: add missing generic argument
LL | type B = Result;
| +++
-error[E0107]: this enum takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: enum takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/wrong-number-of-args.rs:342:18
|
LL | type C = Result<'static>;
@@ -977,7 +977,7 @@ LL | type C = Result<'static>;
| |
| expected 0 lifetime arguments
-error[E0107]: this enum takes 2 generic arguments but 0 generic arguments were supplied
+error[E0107]: enum takes 2 generic arguments but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:342:18
|
LL | type C = Result<'static>;
@@ -988,7 +988,7 @@ help: add missing generic arguments
LL | type C = Result<'static, T, E>;
| ++++++
-error[E0107]: this enum takes 2 generic arguments but 3 generic arguments were supplied
+error[E0107]: enum takes 2 generic arguments but 3 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:348:18
|
LL | type D = Result;
@@ -996,7 +996,7 @@ LL | type D = Result;
| |
| expected 2 generic arguments
-error[E0107]: this enum takes 2 generic arguments but 0 generic arguments were supplied
+error[E0107]: enum takes 2 generic arguments but 0 generic arguments were supplied
--> $DIR/wrong-number-of-args.rs:352:18
|
LL | type E = Result<>;
diff --git a/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr b/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr
index c8b82783ea841..9c10110187042 100644
--- a/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr
+++ b/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/explicit-generic-args-for-impl.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this function takes 1 generic argument but 2 generic arguments were supplied
+error[E0107]: function takes 1 generic argument but 2 generic arguments were supplied
--> $DIR/explicit-generic-args-for-impl.rs:4:5
|
LL | foo::("".to_string());
diff --git a/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr b/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr
index 9d6db88d36433..a26460c8ecc3a 100644
--- a/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr
+++ b/tests/ui/impl-trait/explicit-generic-args-with-impl-trait/not-enough-args.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this function takes 2 generic arguments but 1 generic argument was supplied
+error[E0107]: function takes 2 generic arguments but 1 generic argument was supplied
--> $DIR/not-enough-args.rs:4:5
|
LL | f::<[u8]>("a", b"a");
diff --git a/tests/ui/issues/issue-106755.rs b/tests/ui/issues/issue-106755.rs
new file mode 100644
index 0000000000000..46ece725fb7c1
--- /dev/null
+++ b/tests/ui/issues/issue-106755.rs
@@ -0,0 +1,19 @@
+// compile-flags:-Ztranslate-lang=en_US
+
+#![feature(negative_impls)]
+#![feature(marker_trait_attr)]
+
+#[marker]
+trait MyTrait {}
+
+struct TestType(::std::marker::PhantomData);
+
+unsafe impl Send for TestType {}
+
+impl !Send for TestType {} //~ ERROR found both positive and negative implementation
+
+unsafe impl Send for TestType {} //~ ERROR conflicting implementations
+
+impl !Send for TestType {}
+
+fn main() {}
diff --git a/tests/ui/issues/issue-106755.stderr b/tests/ui/issues/issue-106755.stderr
new file mode 100644
index 0000000000000..543970340620d
--- /dev/null
+++ b/tests/ui/issues/issue-106755.stderr
@@ -0,0 +1,22 @@
+error[E0751]: found both positive and negative implementation of trait `Send` for type `TestType<_>`:
+ --> $DIR/issue-106755.rs:13:1
+ |
+LL | unsafe impl Send for TestType {}
+ | ------------------------------------------------------ positive implementation here
+LL |
+LL | impl !Send for TestType {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here
+
+error[E0119]: conflicting implementations of trait `Send` for type `TestType<_>`
+ --> $DIR/issue-106755.rs:15:1
+ |
+LL | unsafe impl Send for TestType {}
+ | ------------------------------------------------------ first implementation here
+...
+LL | unsafe impl Send for TestType {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `TestType<_>`
+
+error: aborting due to 2 previous errors
+
+Some errors have detailed explanations: E0119, E0751.
+For more information about an error, try `rustc --explain E0119`.
diff --git a/tests/ui/issues/issue-18423.rs b/tests/ui/issues/issue-18423.rs
index a81b32f050c38..675fd041154be 100644
--- a/tests/ui/issues/issue-18423.rs
+++ b/tests/ui/issues/issue-18423.rs
@@ -2,7 +2,7 @@
struct Foo<'a> {
x: Box<'a, isize>
- //~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+ //~^ ERROR struct takes 0 lifetime arguments but 1 lifetime argument was supplied
}
fn main() { }
diff --git a/tests/ui/issues/issue-18423.stderr b/tests/ui/issues/issue-18423.stderr
index bbf79366244a0..5d154dbbbdd6e 100644
--- a/tests/ui/issues/issue-18423.stderr
+++ b/tests/ui/issues/issue-18423.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: struct takes 0 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/issue-18423.rs:4:8
|
LL | x: Box<'a, isize>
diff --git a/tests/ui/issues/issue-3214.rs b/tests/ui/issues/issue-3214.rs
index 928a65938b7ce..e3c07bb3f724f 100644
--- a/tests/ui/issues/issue-3214.rs
+++ b/tests/ui/issues/issue-3214.rs
@@ -4,7 +4,7 @@ fn foo() {
}
impl Drop for Foo {
- //~^ ERROR this struct takes 0 generic arguments but 1 generic argument
+ //~^ ERROR struct takes 0 generic arguments but 1 generic argument
fn drop(&mut self) {}
}
}
diff --git a/tests/ui/issues/issue-3214.stderr b/tests/ui/issues/issue-3214.stderr
index aa0b5ce64b421..7a2d772f0a1b5 100644
--- a/tests/ui/issues/issue-3214.stderr
+++ b/tests/ui/issues/issue-3214.stderr
@@ -8,7 +8,7 @@ LL | struct Foo {
LL | x: T,
| ^ use of generic parameter from outer function
-error[E0107]: this struct takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: struct takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-3214.rs:6:22
|
LL | impl Drop for Foo {
diff --git a/tests/ui/issues/issue-53251.rs b/tests/ui/issues/issue-53251.rs
index 240826a161d97..da3ba63ef67d1 100644
--- a/tests/ui/issues/issue-53251.rs
+++ b/tests/ui/issues/issue-53251.rs
@@ -9,8 +9,8 @@ macro_rules! impl_add {
$(
fn $n() {
S::f::();
- //~^ ERROR this associated function takes 0 generic
- //~| ERROR this associated function takes 0 generic
+ //~^ ERROR associated function takes 0 generic
+ //~| ERROR associated function takes 0 generic
}
)*
}
diff --git a/tests/ui/issues/issue-53251.stderr b/tests/ui/issues/issue-53251.stderr
index cee9a5deb05e1..d5f14e8deb90a 100644
--- a/tests/ui/issues/issue-53251.stderr
+++ b/tests/ui/issues/issue-53251.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-53251.rs:11:20
|
LL | S::f::();
@@ -16,7 +16,7 @@ LL | fn f() {}
| ^
= note: this error originates in the macro `impl_add` (in Nightly builds, run with -Z macro-backtrace for more info)
-error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-53251.rs:11:20
|
LL | S::f::();
diff --git a/tests/ui/issues/issue-60622.rs b/tests/ui/issues/issue-60622.rs
index 7347957906c0a..7b9443eee5013 100644
--- a/tests/ui/issues/issue-60622.rs
+++ b/tests/ui/issues/issue-60622.rs
@@ -9,7 +9,7 @@ impl Borked {
fn run_wild(b: &Borked) {
b.a::<'_, T>();
//~^ ERROR cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
- //~| ERROR this method takes 0 generic arguments but 1 generic argument
+ //~| ERROR method takes 0 generic arguments but 1 generic argument
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
}
diff --git a/tests/ui/issues/issue-60622.stderr b/tests/ui/issues/issue-60622.stderr
index 69b532b8f97e1..43da2773940e5 100644
--- a/tests/ui/issues/issue-60622.stderr
+++ b/tests/ui/issues/issue-60622.stderr
@@ -16,7 +16,7 @@ LL | #![deny(warnings)]
| ^^^^^^^^
= note: `#[deny(late_bound_lifetime_arguments)]` implied by `#[deny(warnings)]`
-error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-60622.rs:10:7
|
LL | b.a::<'_, T>();
diff --git a/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs b/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs
index 0b331e2039f25..792563fd82b35 100644
--- a/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs
+++ b/tests/ui/late-bound-lifetimes/mismatched_arg_count.rs
@@ -7,6 +7,6 @@ trait Trait<'a> {
type Alias<'a, T> = >::Assoc;
fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
-//~^ error: this type alias takes 1 lifetime argument but 2 lifetime arguments were supplied
+//~^ error: type alias takes 1 lifetime argument but 2 lifetime arguments were supplied
fn main() {}
diff --git a/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr b/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr
index 3704d9bb957ed..de58a014ee8fa 100644
--- a/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr
+++ b/tests/ui/late-bound-lifetimes/mismatched_arg_count.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this type alias takes 1 lifetime argument but 2 lifetime arguments were supplied
+error[E0107]: type alias takes 1 lifetime argument but 2 lifetime arguments were supplied
--> $DIR/mismatched_arg_count.rs:9:29
|
LL | fn bar<'a, T: Trait<'a>>(_: Alias<'a, 'a, T>) {}
diff --git a/tests/ui/methods/method-call-lifetime-args-fail.rs b/tests/ui/methods/method-call-lifetime-args-fail.rs
index 2e5c9a0b891d4..1f13de094bbf8 100644
--- a/tests/ui/methods/method-call-lifetime-args-fail.rs
+++ b/tests/ui/methods/method-call-lifetime-args-fail.rs
@@ -14,9 +14,9 @@ impl S {
fn method_call() {
S.early(); // OK
S.early::<'static>();
- //~^ ERROR this method takes 2 lifetime arguments but 1 lifetime argument
+ //~^ ERROR method takes 2 lifetime arguments but 1 lifetime argument
S.early::<'static, 'static, 'static>();
- //~^ ERROR this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
+ //~^ ERROR method takes 2 lifetime arguments but 3 lifetime arguments were supplied
let _: &u8 = S.life_and_type::<'static>();
S.life_and_type::();
S.life_and_type::<'static, u8>();
@@ -61,9 +61,9 @@ fn ufcs() {
S::early(S); // OK
S::early::<'static>(S);
- //~^ ERROR this method takes 2 lifetime arguments but 1 lifetime argument
+ //~^ ERROR method takes 2 lifetime arguments but 1 lifetime argument
S::early::<'static, 'static, 'static>(S);
- //~^ ERROR this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
+ //~^ ERROR method takes 2 lifetime arguments but 3 lifetime arguments were supplied
let _: &u8 = S::life_and_type::<'static>(S);
S::life_and_type::(S);
S::life_and_type::<'static, u8>(S);
diff --git a/tests/ui/methods/method-call-lifetime-args-fail.stderr b/tests/ui/methods/method-call-lifetime-args-fail.stderr
index 45ff32bdd4cab..34526256f9975 100644
--- a/tests/ui/methods/method-call-lifetime-args-fail.stderr
+++ b/tests/ui/methods/method-call-lifetime-args-fail.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this method takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: method takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/method-call-lifetime-args-fail.rs:16:7
|
LL | S.early::<'static>();
@@ -16,7 +16,7 @@ help: add missing lifetime argument
LL | S.early::<'static, 'static>();
| +++++++++
-error[E0107]: this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
+error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:18:7
|
LL | S.early::<'static, 'static, 'static>();
@@ -198,7 +198,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} }
| ^^
-error[E0107]: this method takes 2 lifetime arguments but 1 lifetime argument was supplied
+error[E0107]: method takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/method-call-lifetime-args-fail.rs:63:8
|
LL | S::early::<'static>(S);
@@ -216,7 +216,7 @@ help: add missing lifetime argument
LL | S::early::<'static, 'static>(S);
| +++++++++
-error[E0107]: this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
+error[E0107]: method takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:65:8
|
LL | S::early::<'static, 'static, 'static>(S);
diff --git a/tests/ui/seq-args.rs b/tests/ui/seq-args.rs
index a5ebeecd3116c..627dfcc31986a 100644
--- a/tests/ui/seq-args.rs
+++ b/tests/ui/seq-args.rs
@@ -2,12 +2,12 @@ fn main() {
trait Seq { }
impl Seq for Vec {
- //~^ ERROR this trait takes 0 generic arguments but 1 generic argument
+ //~^ ERROR trait takes 0 generic arguments but 1 generic argument
/* ... */
}
impl Seq for u32 {
- //~^ ERROR this trait takes 0 generic arguments but 1 generic argument
+ //~^ ERROR trait takes 0 generic arguments but 1 generic argument
/* Treat the integer as a sequence of bits */
}
}
diff --git a/tests/ui/seq-args.stderr b/tests/ui/seq-args.stderr
index c404d95748b5c..a5b0f8e98dca0 100644
--- a/tests/ui/seq-args.stderr
+++ b/tests/ui/seq-args.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/seq-args.rs:4:13
|
LL | impl Seq for Vec {
@@ -12,7 +12,7 @@ note: trait defined here, with 0 generic parameters
LL | trait Seq { }
| ^^^
-error[E0107]: this trait takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: trait takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/seq-args.rs:9:10
|
LL | impl Seq for u32 {
diff --git a/tests/ui/structs/struct-path-associated-type.rs b/tests/ui/structs/struct-path-associated-type.rs
index 2dd7174a9bed8..74d9705d4b89d 100644
--- a/tests/ui/structs/struct-path-associated-type.rs
+++ b/tests/ui/structs/struct-path-associated-type.rs
@@ -13,7 +13,7 @@ fn f() {
//~^ ERROR expected struct, variant or union type, found associated type
let z = T::A:: {};
//~^ ERROR expected struct, variant or union type, found associated type
- //~| ERROR this associated type takes 0 generic arguments but 1 generic argument was supplied
+ //~| ERROR associated type takes 0 generic arguments but 1 generic argument was supplied
match S {
T::A {} => {}
//~^ ERROR expected struct, variant or union type, found associated type
@@ -22,7 +22,7 @@ fn f() {
fn g>() {
let s = T::A {}; // OK
- let z = T::A:: {}; //~ ERROR this associated type takes 0 generic arguments but 1 generic argument was supplied
+ let z = T::A:: {}; //~ ERROR associated type takes 0 generic arguments but 1 generic argument was supplied
match S {
T::A {} => {} // OK
}
diff --git a/tests/ui/structs/struct-path-associated-type.stderr b/tests/ui/structs/struct-path-associated-type.stderr
index ca5f0b7e21e7d..acfddaf37607d 100644
--- a/tests/ui/structs/struct-path-associated-type.stderr
+++ b/tests/ui/structs/struct-path-associated-type.stderr
@@ -4,7 +4,7 @@ error[E0071]: expected struct, variant or union type, found associated type
LL | let s = T::A {};
| ^^^^ not a struct
-error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/struct-path-associated-type.rs:14:16
|
LL | let z = T::A:: {};
@@ -30,7 +30,7 @@ error[E0071]: expected struct, variant or union type, found associated type
LL | T::A {} => {}
| ^^^^ not a struct
-error[E0107]: this associated type takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated type takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/struct-path-associated-type.rs:25:16
|
LL | let z = T::A:: {};
diff --git a/tests/ui/structs/structure-constructor-type-mismatch.rs b/tests/ui/structs/structure-constructor-type-mismatch.rs
index a03ef590cb3a1..21cd9d08b21d1 100644
--- a/tests/ui/structs/structure-constructor-type-mismatch.rs
+++ b/tests/ui/structs/structure-constructor-type-mismatch.rs
@@ -45,13 +45,13 @@ fn main() {
y: 8,
};
- let pt3 = PointF:: { //~ ERROR this type alias takes 0 generic arguments but 1 generic argument
+ let pt3 = PointF:: { //~ ERROR type alias takes 0 generic arguments but 1 generic argument
x: 9, //~ ERROR mismatched types
y: 10, //~ ERROR mismatched types
};
match (Point { x: 1, y: 2 }) {
- PointF:: { .. } => {} //~ ERROR this type alias takes 0 generic arguments but 1 generic argument
+ PointF:: { .. } => {} //~ ERROR type alias takes 0 generic arguments but 1 generic argument
//~^ ERROR mismatched types
}
diff --git a/tests/ui/structs/structure-constructor-type-mismatch.stderr b/tests/ui/structs/structure-constructor-type-mismatch.stderr
index 3e3f9ea06eff3..63dda459396b8 100644
--- a/tests/ui/structs/structure-constructor-type-mismatch.stderr
+++ b/tests/ui/structs/structure-constructor-type-mismatch.stderr
@@ -52,7 +52,7 @@ LL | x: 7,
| expected `f32`, found integer
| help: use a float literal: `7.0`
-error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/structure-constructor-type-mismatch.rs:48:15
|
LL | let pt3 = PointF:: {
@@ -84,7 +84,7 @@ LL | y: 10,
| expected `f32`, found integer
| help: use a float literal: `10.0`
-error[E0107]: this type alias takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: type alias takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/structure-constructor-type-mismatch.rs:54:9
|
LL | PointF:: { .. } => {}
diff --git a/tests/ui/suggestions/issue-101421.rs b/tests/ui/suggestions/issue-101421.rs
index 53b1e88573776..1407ebd277cb6 100644
--- a/tests/ui/suggestions/issue-101421.rs
+++ b/tests/ui/suggestions/issue-101421.rs
@@ -8,5 +8,5 @@ impl Ice for () {
fn main() {
().f::<()>(());
- //~^ ERROR this method takes 0 generic arguments but 1 generic argument was supplied
+ //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied
}
diff --git a/tests/ui/suggestions/issue-101421.stderr b/tests/ui/suggestions/issue-101421.stderr
index 8362f02bbe434..2656ab3db0bc3 100644
--- a/tests/ui/suggestions/issue-101421.stderr
+++ b/tests/ui/suggestions/issue-101421.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-101421.rs:10:8
|
LL | ().f::<()>(());
diff --git a/tests/ui/suggestions/issue-104287.rs b/tests/ui/suggestions/issue-104287.rs
index 752282e065d3d..37b3339fa923e 100644
--- a/tests/ui/suggestions/issue-104287.rs
+++ b/tests/ui/suggestions/issue-104287.rs
@@ -8,6 +8,6 @@ impl S {
fn main() {
let x = S;
foo::<()>(x);
- //~^ ERROR this method takes 0 generic arguments but 1 generic argument was supplied
+ //~^ ERROR method takes 0 generic arguments but 1 generic argument was supplied
//~| ERROR cannot find function `foo` in this scope
}
diff --git a/tests/ui/suggestions/issue-104287.stderr b/tests/ui/suggestions/issue-104287.stderr
index d363601e95234..ed59b2e7a2d3b 100644
--- a/tests/ui/suggestions/issue-104287.stderr
+++ b/tests/ui/suggestions/issue-104287.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-104287.rs:10:5
|
LL | foo::<()>(x);
diff --git a/tests/ui/suggestions/issue-85347.rs b/tests/ui/suggestions/issue-85347.rs
index 02b5fb61894e9..04d4c47d8e583 100644
--- a/tests/ui/suggestions/issue-85347.rs
+++ b/tests/ui/suggestions/issue-85347.rs
@@ -1,7 +1,7 @@
use std::ops::Deref;
trait Foo {
type Bar<'a>: Deref::Bar>;
- //~^ ERROR this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+ //~^ ERROR associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
//~| ERROR associated type bindings are not allowed here
//~| HELP add missing
}
diff --git a/tests/ui/suggestions/issue-85347.stderr b/tests/ui/suggestions/issue-85347.stderr
index 17c1b7dc4cce9..f330b3c1faded 100644
--- a/tests/ui/suggestions/issue-85347.stderr
+++ b/tests/ui/suggestions/issue-85347.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
+error[E0107]: associated type takes 1 lifetime argument but 0 lifetime arguments were supplied
--> $DIR/issue-85347.rs:3:42
|
LL | type Bar<'a>: Deref::Bar>;
diff --git a/tests/ui/suggestions/issue-89064.stderr b/tests/ui/suggestions/issue-89064.stderr
index b238c1804ee91..be09dd8951208 100644
--- a/tests/ui/suggestions/issue-89064.stderr
+++ b/tests/ui/suggestions/issue-89064.stderr
@@ -1,4 +1,4 @@
-error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-89064.rs:17:16
|
LL | let _ = A::foo::();
@@ -20,7 +20,7 @@ LL - let _ = A::foo::();
LL + let _ = A::foo();
|
-error[E0107]: this associated function takes 0 generic arguments but 2 generic arguments were supplied
+error[E0107]: associated function takes 0 generic arguments but 2 generic arguments were supplied
--> $DIR/issue-89064.rs:22:16
|
LL | let _ = B::bar::();
@@ -42,7 +42,7 @@ LL - let _ = B::bar::();
LL + let _ = B::bar();
|
-error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: associated function takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-89064.rs:27:21
|
LL | let _ = A::::foo::();
@@ -56,7 +56,7 @@ note: associated function defined here, with 0 generic parameters
LL | fn foo() {}
| ^^^
-error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
+error[E0107]: method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-89064.rs:31:16
|
LL | let _ = 42.into::