diff --git a/Cargo.lock b/Cargo.lock index 5253c819ca2c9..4ed8818cbad97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -356,7 +356,7 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.1" +version = "0.1.2" dependencies = [ "serde", ] @@ -1723,9 +1723,9 @@ checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" [[package]] name = "jobserver" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" +checksum = "f5ca711fd837261e14ec9e674f092cbb931d3fa1482b017ae59328ddc6f3212b" dependencies = [ "libc", ] diff --git a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs index 8669846074749..1c4d307fc50e1 100644 --- a/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs +++ b/compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs @@ -1136,6 +1136,11 @@ pub(crate) fn codegen_intrinsic_call<'tcx>( }; ret.write_cvalue(fx, CValue::by_val(is_eq_value, ret.layout())); }; + + black_box, (c a) { + // FIXME implement black_box semantics + ret.write_cvalue(fx, a); + }; } if let Some((_, dest)) = destination { diff --git a/compiler/rustc_codegen_llvm/src/asm.rs b/compiler/rustc_codegen_llvm/src/asm.rs index ebc3773df57cd..4790b44bd19ef 100644 --- a/compiler/rustc_codegen_llvm/src/asm.rs +++ b/compiler/rustc_codegen_llvm/src/asm.rs @@ -425,7 +425,7 @@ impl AsmMethods for CodegenCx<'ll, 'tcx> { } } -fn inline_asm_call( +pub(crate) fn inline_asm_call( bx: &mut Builder<'a, 'll, 'tcx>, asm: &str, cons: &str, diff --git a/compiler/rustc_codegen_llvm/src/intrinsic.rs b/compiler/rustc_codegen_llvm/src/intrinsic.rs index ed48418586517..fe2ed21c1e3b0 100644 --- a/compiler/rustc_codegen_llvm/src/intrinsic.rs +++ b/compiler/rustc_codegen_llvm/src/intrinsic.rs @@ -7,6 +7,7 @@ use crate::type_of::LayoutLlvmExt; use crate::va_arg::emit_va_arg; use crate::value::Value; +use rustc_ast as ast; use rustc_codegen_ssa::base::{compare_simd_types, wants_msvc_seh}; use rustc_codegen_ssa::common::span_invalid_monomorphization_error; use rustc_codegen_ssa::common::{IntPredicate, TypeKind}; @@ -327,6 +328,31 @@ impl IntrinsicCallMethods<'tcx> for Builder<'a, 'll, 'tcx> { } } + sym::black_box => { + args[0].val.store(self, result); + + // We need to "use" the argument in some way LLVM can't introspect, and on + // targets that support it we can typically leverage inline assembly to do + // this. LLVM's interpretation of inline assembly is that it's, well, a black + // box. This isn't the greatest implementation since it probably deoptimizes + // more than we want, but it's so far good enough. + crate::asm::inline_asm_call( + self, + "", + "r,~{memory}", + &[result.llval], + self.type_void(), + true, + false, + ast::LlvmAsmDialect::Att, + &[span], + ) + .unwrap_or_else(|| bug!("failed to generate inline asm call for `black_box`")); + + // We have copied the value to `result` already. + return; + } + _ if name_str.starts_with("simd_") => { match generic_simd_intrinsic(self, name, callee_ty, args, ret_ty, llret_ty, span) { Ok(llval) => llval, diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs index 84dd69ebd9634..fcc70b2e4c5ff 100644 --- a/compiler/rustc_driver/src/lib.rs +++ b/compiler/rustc_driver/src/lib.rs @@ -1287,9 +1287,6 @@ pub fn init_env_logger(env: &str) { .with_indent_lines(true) .with_ansi(color_logs) .with_targets(true) - .with_wraparound(10) - .with_verbose_exit(true) - .with_verbose_entry(true) .with_indent_amount(2); #[cfg(parallel_compiler)] let layer = layer.with_thread_ids(true).with_thread_names(true); diff --git a/compiler/rustc_lexer/src/unescape.rs b/compiler/rustc_lexer/src/unescape.rs index 9a96c03cd3c80..b970c9e4911fa 100644 --- a/compiler/rustc_lexer/src/unescape.rs +++ b/compiler/rustc_lexer/src/unescape.rs @@ -60,6 +60,9 @@ pub enum EscapeError { /// After a line ending with '\', the next line contains whitespace /// characters that are not skipped. UnskippedWhitespaceWarning, + + /// After a line ending with '\', multiple lines are skipped. + MultipleSkippedLinesWarning, } impl EscapeError { @@ -67,6 +70,7 @@ impl EscapeError { pub fn is_fatal(&self) -> bool { match self { EscapeError::UnskippedWhitespaceWarning => false, + EscapeError::MultipleSkippedLinesWarning => false, _ => true, } } @@ -315,12 +319,17 @@ where where F: FnMut(Range, Result), { - let str = chars.as_str(); - let first_non_space = str + let tail = chars.as_str(); + let first_non_space = tail .bytes() .position(|b| b != b' ' && b != b'\t' && b != b'\n' && b != b'\r') - .unwrap_or(str.len()); - let tail = &str[first_non_space..]; + .unwrap_or(tail.len()); + if tail[1..first_non_space].contains('\n') { + // The +1 accounts for the escaping slash. + let end = start + first_non_space + 1; + callback(start..end, Err(EscapeError::MultipleSkippedLinesWarning)); + } + let tail = &tail[first_non_space..]; if let Some(c) = tail.chars().nth(0) { // For error reporting, we would like the span to contain the character that was not // skipped. The +1 is necessary to account for the leading \ that started the escape. diff --git a/compiler/rustc_lexer/src/unescape/tests.rs b/compiler/rustc_lexer/src/unescape/tests.rs index 1f4dbb20f4e98..fa61554afde6c 100644 --- a/compiler/rustc_lexer/src/unescape/tests.rs +++ b/compiler/rustc_lexer/src/unescape/tests.rs @@ -106,6 +106,10 @@ fn test_unescape_str_warn() { assert_eq!(unescaped, expected); } + // Check we can handle escaped newlines at the end of a file. + check("\\\n", &[]); + check("\\\n ", &[]); + check( "\\\n \u{a0} x", &[ @@ -115,6 +119,7 @@ fn test_unescape_str_warn() { (6..7, Ok('x')), ], ); + check("\\\n \n x", &[(0..7, Err(EscapeError::MultipleSkippedLinesWarning)), (7..8, Ok('x'))]); } #[test] diff --git a/compiler/rustc_lint/src/array_into_iter.rs b/compiler/rustc_lint/src/array_into_iter.rs index 77741c7240b0d..21fad5f9af683 100644 --- a/compiler/rustc_lint/src/array_into_iter.rs +++ b/compiler/rustc_lint/src/array_into_iter.rs @@ -32,7 +32,7 @@ declare_lint! { Warn, "detects calling `into_iter` on arrays in Rust 2015 and 2018", @future_incompatible = FutureIncompatibleInfo { - reference: "issue #66145 ", + reference: "", reason: FutureIncompatibilityReason::EditionSemanticsChange(Edition::Edition2021), }; } diff --git a/compiler/rustc_lint/src/builtin.rs b/compiler/rustc_lint/src/builtin.rs index f341ca686593c..31d0d917f9093 100644 --- a/compiler/rustc_lint/src/builtin.rs +++ b/compiler/rustc_lint/src/builtin.rs @@ -1680,7 +1680,7 @@ declare_lint! { Warn, "`...` range patterns are deprecated", @future_incompatible = FutureIncompatibleInfo { - reference: "issue #80165 ", + reference: "", reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), }; } diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 1998386603f12..9ea17e0ccb613 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -1605,7 +1605,7 @@ declare_lint! { Warn, "suggest using `dyn Trait` for trait objects", @future_incompatible = FutureIncompatibleInfo { - reference: "issue #80165 ", + reference: "", reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), }; } @@ -3247,7 +3247,7 @@ declare_lint! { Allow, "detects usage of old versions of or-patterns", @future_incompatible = FutureIncompatibleInfo { - reference: "issue #84869 ", + reference: "", reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), }; } @@ -3296,7 +3296,7 @@ declare_lint! { "detects the usage of trait methods which are ambiguous with traits added to the \ prelude in future editions", @future_incompatible = FutureIncompatibleInfo { - reference: "issue #85684 ", + reference: "", reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), }; } @@ -3331,7 +3331,7 @@ declare_lint! { Allow, "identifiers that will be parsed as a prefix in Rust 2021", @future_incompatible = FutureIncompatibleInfo { - reference: "issue #84978 ", + reference: "", reason: FutureIncompatibilityReason::EditionError(Edition::Edition2021), }; crate_level_only diff --git a/compiler/rustc_mir/src/interpret/intrinsics.rs b/compiler/rustc_mir/src/interpret/intrinsics.rs index dc1f9053b61f0..bfab886b6ee4f 100644 --- a/compiler/rustc_mir/src/interpret/intrinsics.rs +++ b/compiler/rustc_mir/src/interpret/intrinsics.rs @@ -465,7 +465,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { ); self.copy_op(&self.operand_index(&args[0], index)?, dest)?; } - sym::likely | sym::unlikely => { + sym::likely | sym::unlikely | sym::black_box => { // These just return their argument self.copy_op(&args[0], dest)?; } diff --git a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs index 4e95cdc0efa5f..aa6b424ce2b57 100644 --- a/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs +++ b/compiler/rustc_parse/src/lexer/unescape_error_reporting.rs @@ -280,6 +280,11 @@ pub(crate) fn emit_unescape_error( format!("non-ASCII whitespace symbol '{}' is not skipped", c.escape_unicode()); handler.struct_span_warn(span, &msg).span_label(char_span, &msg).emit(); } + EscapeError::MultipleSkippedLinesWarning => { + let msg = "multiple lines skipped by escaped newline"; + let bottom_msg = "skipping everything up to and including this point"; + handler.struct_span_warn(span, msg).span_label(span, bottom_msg).emit(); + } } } diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 3f5d8273b38b8..6d03f1a37329e 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -335,6 +335,7 @@ symbols! { bitreverse, bitxor, bitxor_assign, + black_box, block, bool, borrowck_graphviz_format, diff --git a/compiler/rustc_typeck/src/check/intrinsic.rs b/compiler/rustc_typeck/src/check/intrinsic.rs index 6661df21ed952..664954b0eb7a2 100644 --- a/compiler/rustc_typeck/src/check/intrinsic.rs +++ b/compiler/rustc_typeck/src/check/intrinsic.rs @@ -102,6 +102,7 @@ pub fn intrinsic_operation_unsafety(intrinsic: Symbol) -> hir::Unsafety { | sym::maxnumf64 | sym::type_name | sym::forget + | sym::black_box | sym::variant_count => hir::Unsafety::Normal, _ => hir::Unsafety::Unsafe, } @@ -387,6 +388,8 @@ pub fn check_intrinsic_type(tcx: TyCtxt<'_>, it: &hir::ForeignItem<'_>) { (1, vec![param_ty; 2], tcx.types.bool) } + sym::black_box => (1, vec![param(0)], param(0)), + other => { tcx.sess.emit_err(UnrecognizedIntrinsicFunction { span: it.span, name: other }); return; diff --git a/library/core/src/hint.rs b/library/core/src/hint.rs index a0b65399da2c5..a4924554919b0 100644 --- a/library/core/src/hint.rs +++ b/library/core/src/hint.rs @@ -152,23 +152,19 @@ pub fn spin_loop() { /// backend used. Programs cannot rely on `black_box` for *correctness* in any way. /// /// [`std::convert::identity`]: crate::convert::identity -#[cfg_attr(not(miri), inline)] -#[cfg_attr(miri, inline(never))] +#[inline] #[unstable(feature = "bench_black_box", issue = "64102")] -#[cfg_attr(miri, allow(unused_mut))] +#[cfg_attr(not(bootstrap), allow(unused_mut))] pub fn black_box(mut dummy: T) -> T { - // We need to "use" the argument in some way LLVM can't introspect, and on - // targets that support it we can typically leverage inline assembly to do - // this. LLVM's interpretation of inline assembly is that it's, well, a black - // box. This isn't the greatest implementation since it probably deoptimizes - // more than we want, but it's so far good enough. - - #[cfg(not(miri))] // This is just a hint, so it is fine to skip in Miri. + #[cfg(bootstrap)] // SAFETY: the inline assembly is a no-op. unsafe { - // FIXME: Cannot use `asm!` because it doesn't support MIPS and other architectures. llvm_asm!("" : : "r"(&mut dummy) : "memory" : "volatile"); + dummy } - dummy + #[cfg(not(bootstrap))] + { + crate::intrinsics::black_box(dummy) + } } diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index d15ac89668fa3..272b1e3a1d75e 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -1933,6 +1933,12 @@ extern "rust-intrinsic" { /// which is UB if any of their inputs are `undef`.) #[rustc_const_unstable(feature = "const_intrinsic_raw_eq", issue = "none")] pub fn raw_eq(a: &T, b: &T) -> bool; + + /// See documentation of [`std::hint::black_box`] for details. + /// + /// [`std::hint::black_box`]: crate::hint::black_box + #[cfg(not(bootstrap))] + pub fn black_box(dummy: T) -> T; } // Some functions are defined here because they accidentally got made diff --git a/library/core/src/iter/traits/collect.rs b/library/core/src/iter/traits/collect.rs index 7f87ead6feed6..aa91346851f9d 100644 --- a/library/core/src/iter/traits/collect.rs +++ b/library/core/src/iter/traits/collect.rs @@ -360,3 +360,61 @@ impl Extend<()> for () { } fn extend_one(&mut self, _item: ()) {} } + +#[stable(feature = "extend_for_tuple", since = "1.56.0")] +impl Extend<(A, B)> for (ExtendA, ExtendB) +where + ExtendA: Extend, + ExtendB: Extend, +{ + /// Allows to `extend` a tuple of collections that also implement `Extend`. + /// + /// See also: [`Iterator::unzip`] + /// + /// # Examples + /// ``` + /// let mut tuple = (vec![0], vec![1]); + /// tuple.extend(vec![(2, 3), (4, 5), (6, 7)]); + /// assert_eq!(tuple.0, vec![0, 2, 4, 6]); + /// assert_eq!(tuple.1, vec![1, 3, 5, 7]); + /// + /// // also allows for arbitrarily nested tuples + /// let mut nested_tuple = (vec![(1, -1)], vec![(2, -2)]); + /// nested_tuple.extend(vec![((3, -3), (4, -4)), ((5, -5), (6, -6))]); + /// + /// assert_eq!(nested_tuple.0, vec![(1, -1), (3, -3), (5, -5)]); + /// assert_eq!(nested_tuple.1, vec![(2, -2), (4, -4), (6, -6)]); + /// ``` + fn extend>(&mut self, into_iter: T) { + let (a, b) = self; + let iter = into_iter.into_iter(); + + fn extend<'a, A, B>( + a: &'a mut impl Extend, + b: &'a mut impl Extend, + ) -> impl FnMut((), (A, B)) + 'a { + move |(), (t, u)| { + a.extend_one(t); + b.extend_one(u); + } + } + + let (lower_bound, _) = iter.size_hint(); + if lower_bound > 0 { + a.extend_reserve(lower_bound); + b.extend_reserve(lower_bound); + } + + iter.fold((), extend(a, b)); + } + + fn extend_one(&mut self, item: (A, B)) { + self.0.extend_one(item.0); + self.1.extend_one(item.1); + } + + fn extend_reserve(&mut self, additional: usize) { + self.0.extend_reserve(additional); + self.1.extend_reserve(additional); + } +} diff --git a/library/core/src/iter/traits/iterator.rs b/library/core/src/iter/traits/iterator.rs index 6b24d33bebca3..524d8f857e2a5 100644 --- a/library/core/src/iter/traits/iterator.rs +++ b/library/core/src/iter/traits/iterator.rs @@ -2841,6 +2841,14 @@ pub trait Iterator { /// /// assert_eq!(left, [1, 3]); /// assert_eq!(right, [2, 4]); + /// + /// // you can also unzip multiple nested tuples at once + /// let a = [(1, (2, 3)), (4, (5, 6))]; + /// + /// let (x, (y, z)): (Vec<_>, (Vec<_>, Vec<_>)) = a.iter().cloned().unzip(); + /// assert_eq!(x, [1, 4]); + /// assert_eq!(y, [2, 5]); + /// assert_eq!(z, [3, 6]); /// ``` #[stable(feature = "rust1", since = "1.0.0")] fn unzip(self) -> (FromA, FromB) @@ -2849,28 +2857,9 @@ pub trait Iterator { FromB: Default + Extend, Self: Sized + Iterator, { - fn extend<'a, A, B>( - ts: &'a mut impl Extend, - us: &'a mut impl Extend, - ) -> impl FnMut((), (A, B)) + 'a { - move |(), (t, u)| { - ts.extend_one(t); - us.extend_one(u); - } - } - - let mut ts: FromA = Default::default(); - let mut us: FromB = Default::default(); - - let (lower_bound, _) = self.size_hint(); - if lower_bound > 0 { - ts.extend_reserve(lower_bound); - us.extend_reserve(lower_bound); - } - - self.fold((), extend(&mut ts, &mut us)); - - (ts, us) + let mut unzipped: (FromA, FromB) = Default::default(); + unzipped.extend(self); + unzipped } /// Creates an iterator which copies all of its elements. diff --git a/src/doc/book b/src/doc/book index a07036f864b37..7e49659102f09 160000 --- a/src/doc/book +++ b/src/doc/book @@ -1 +1 @@ -Subproject commit a07036f864b37896b31eb996cd7aedb489f69a1f +Subproject commit 7e49659102f0977d9142190e1ba23345c0f00eb1 diff --git a/src/doc/embedded-book b/src/doc/embedded-book index 09986cd352404..4f9fcaa30d11b 160000 --- a/src/doc/embedded-book +++ b/src/doc/embedded-book @@ -1 +1 @@ -Subproject commit 09986cd352404eb4659db44613b27cac9aa652fc +Subproject commit 4f9fcaa30d11ba52b641e6fd5206536d65838af9 diff --git a/src/doc/nomicon b/src/doc/nomicon index f51734eb5566c..0c7e5bd1428e7 160000 --- a/src/doc/nomicon +++ b/src/doc/nomicon @@ -1 +1 @@ -Subproject commit f51734eb5566c826b471977747ea3d7d6915bbe9 +Subproject commit 0c7e5bd1428e7838252bb57b7f0fbfda4ec82f02 diff --git a/src/doc/reference b/src/doc/reference index 3b7be075af5d6..4884fe45c14f8 160000 --- a/src/doc/reference +++ b/src/doc/reference @@ -1 +1 @@ -Subproject commit 3b7be075af5d6e402a18efff672a8a265b4596fd +Subproject commit 4884fe45c14f8b22121760fb117181bb4da8dfe0 diff --git a/src/doc/rustc-dev-guide b/src/doc/rustc-dev-guide index 09343d6f921d2..c4644b427cbda 160000 --- a/src/doc/rustc-dev-guide +++ b/src/doc/rustc-dev-guide @@ -1 +1 @@ -Subproject commit 09343d6f921d2a07c66f8c41ec3d65bf1fa52556 +Subproject commit c4644b427cbdaafc7a87be0ccdf5d8aaa07ac35f diff --git a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr index b93bd6c6fa064..9cfb0180b7df9 100644 --- a/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr +++ b/src/test/ui/const-generics/min_const_generics/const-expression-suggest-missing-braces.stderr @@ -139,7 +139,7 @@ LL | foo::(); | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0747]: type provided when a constant was expected --> $DIR/const-expression-suggest-missing-braces.rs:11:11 diff --git a/src/test/ui/issues/issue-37222.rs b/src/test/ui/consts/issue-37222.rs similarity index 100% rename from src/test/ui/issues/issue-37222.rs rename to src/test/ui/consts/issue-37222.rs diff --git a/src/test/ui/issues/issue-43023.rs b/src/test/ui/derives/issue-43023.rs similarity index 100% rename from src/test/ui/issues/issue-43023.rs rename to src/test/ui/derives/issue-43023.rs diff --git a/src/test/ui/issues/issue-43023.stderr b/src/test/ui/derives/issue-43023.stderr similarity index 100% rename from src/test/ui/issues/issue-43023.stderr rename to src/test/ui/derives/issue-43023.stderr diff --git a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr index 30f09e2279216..c9bb08cf35c1d 100644 --- a/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr +++ b/src/test/ui/dyn-keyword/dyn-2018-edition-lint.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #[deny(bare_trait_objects)] | ^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: trait objects without an explicit `dyn` are deprecated --> $DIR/dyn-2018-edition-lint.rs:4:35 @@ -19,7 +19,7 @@ LL | fn function(x: &SomeTrait, y: Box) { | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: trait objects without an explicit `dyn` are deprecated --> $DIR/dyn-2018-edition-lint.rs:9:14 @@ -28,7 +28,7 @@ LL | let _x: &SomeTrait = todo!(); | ^^^^^^^^^ help: use `dyn`: `dyn SomeTrait` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: aborting due to 3 previous errors diff --git a/src/test/ui/estr-subtyping.rs b/src/test/ui/estr-subtyping.rs deleted file mode 100644 index 9c5825fff8552..0000000000000 --- a/src/test/ui/estr-subtyping.rs +++ /dev/null @@ -1,15 +0,0 @@ -fn wants_uniq(x: String) { } -fn wants_slice(x: &str) { } - -fn has_uniq(x: String) { - wants_uniq(x); - wants_slice(&*x); -} - -fn has_slice(x: &str) { - wants_uniq(x); //~ ERROR mismatched types - wants_slice(x); -} - -fn main() { -} diff --git a/src/test/ui/estr-subtyping.stderr b/src/test/ui/estr-subtyping.stderr deleted file mode 100644 index d929c32633a0a..0000000000000 --- a/src/test/ui/estr-subtyping.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0308]: mismatched types - --> $DIR/estr-subtyping.rs:10:15 - | -LL | wants_uniq(x); - | ^- help: try using a conversion method: `.to_string()` - | | - | expected struct `String`, found `&str` - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/fmt/format-string-error-2.rs b/src/test/ui/fmt/format-string-error-2.rs index 69fed2cb69ad8..1f7f0d8f6be6a 100644 --- a/src/test/ui/fmt/format-string-error-2.rs +++ b/src/test/ui/fmt/format-string-error-2.rs @@ -5,7 +5,7 @@ fn main() { a"); //~^ ERROR invalid format string format!("{ \ - + \ b"); //~^ ERROR invalid format string format!(r#"{ \ @@ -38,12 +38,12 @@ fn main() { { \ \ b \ - + \ "); //~^^^ ERROR invalid format string format!(r#" raw { \ - + \ c"#); //~^^^ ERROR invalid format string format!(r#" diff --git a/src/test/ui/fmt/format-string-error-2.stderr b/src/test/ui/fmt/format-string-error-2.stderr index c421fe49ef0a4..76cdfbb93bf24 100644 --- a/src/test/ui/fmt/format-string-error-2.stderr +++ b/src/test/ui/fmt/format-string-error-2.stderr @@ -19,7 +19,7 @@ error: invalid format string: expected `'}'`, found `'b'` | LL | format!("{ \ | - because of this opening brace -LL | +LL | \ LL | b"); | ^ expected `}` in format string | diff --git a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr index d6fba8b8e4c8a..7dc2ac080171c 100644 --- a/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr +++ b/src/test/ui/generic-associated-types/gat-trait-path-parenthesised-args.stderr @@ -18,7 +18,7 @@ LL | fn foo<'a>(arg: Box>) {} | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0107]: this associated type takes 1 lifetime argument but 0 lifetime arguments were supplied --> $DIR/gat-trait-path-parenthesised-args.rs:7:27 diff --git a/src/test/ui/deref-suggestion.rs b/src/test/ui/inference/deref-suggestion.rs similarity index 100% rename from src/test/ui/deref-suggestion.rs rename to src/test/ui/inference/deref-suggestion.rs diff --git a/src/test/ui/deref-suggestion.stderr b/src/test/ui/inference/deref-suggestion.stderr similarity index 100% rename from src/test/ui/deref-suggestion.stderr rename to src/test/ui/inference/deref-suggestion.stderr diff --git a/src/test/ui/issues/issue-86756.stderr b/src/test/ui/issues/issue-86756.stderr index 1ef2198672660..e4167f27d5778 100644 --- a/src/test/ui/issues/issue-86756.stderr +++ b/src/test/ui/issues/issue-86756.stderr @@ -22,7 +22,7 @@ LL | eq:: | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0107]: missing generics for trait `Foo` --> $DIR/issue-86756.rs:5:15 diff --git a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr index 3bd3ca6e875a1..3347d8449b088 100644 --- a/src/test/ui/iterators/into-iter-on-arrays-2018.stderr +++ b/src/test/ui/iterators/into-iter-on-arrays-2018.stderr @@ -6,7 +6,7 @@ LL | let _: Iter<'_, i32> = array.into_iter(); | = note: `#[warn(array_into_iter)]` on by default = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | let _: Iter<'_, i32> = array.iter(); @@ -23,7 +23,7 @@ LL | let _: Iter<'_, i32> = Box::new(array).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | let _: Iter<'_, i32> = Box::new(array).iter(); @@ -40,7 +40,7 @@ LL | for _ in [1, 2, 3].into_iter() {} | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | for _ in [1, 2, 3].iter() {} diff --git a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr index 01789e0e25748..4b7c0efe903ab 100644 --- a/src/test/ui/iterators/into-iter-on-arrays-lint.stderr +++ b/src/test/ui/iterators/into-iter-on-arrays-lint.stderr @@ -6,7 +6,7 @@ LL | small.into_iter(); | = note: `#[warn(array_into_iter)]` on by default = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | small.iter(); @@ -23,7 +23,7 @@ LL | [1, 2].into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | [1, 2].iter(); @@ -40,7 +40,7 @@ LL | big.into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | big.iter(); @@ -57,7 +57,7 @@ LL | [0u8; 33].into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | [0u8; 33].iter(); @@ -74,7 +74,7 @@ LL | Box::new(small).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new(small).iter(); @@ -91,7 +91,7 @@ LL | Box::new([1, 2]).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new([1, 2]).iter(); @@ -108,7 +108,7 @@ LL | Box::new(big).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new(big).iter(); @@ -125,7 +125,7 @@ LL | Box::new([0u8; 33]).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new([0u8; 33]).iter(); @@ -142,7 +142,7 @@ LL | Box::new(Box::new(small)).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new(Box::new(small)).iter(); @@ -159,7 +159,7 @@ LL | Box::new(Box::new([1, 2])).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new(Box::new([1, 2])).iter(); @@ -176,7 +176,7 @@ LL | Box::new(Box::new(big)).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new(Box::new(big)).iter(); @@ -193,7 +193,7 @@ LL | Box::new(Box::new([0u8; 33])).into_iter(); | ^^^^^^^^^ | = warning: this changes meaning in Rust 2021 - = note: for more information, see issue #66145 + = note: for more information, see help: use `.iter()` instead of `.into_iter()` to avoid ambiguity | LL | Box::new(Box::new([0u8; 33])).iter(); diff --git a/src/test/ui/lint/bare-trait-objects-path.stderr b/src/test/ui/lint/bare-trait-objects-path.stderr index 40fafc4b3b59b..3477b01b6b567 100644 --- a/src/test/ui/lint/bare-trait-objects-path.stderr +++ b/src/test/ui/lint/bare-trait-objects-path.stderr @@ -12,7 +12,7 @@ LL | Dyn::func(); | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: trait objects without an explicit `dyn` are deprecated --> $DIR/bare-trait-objects-path.rs:17:5 @@ -21,7 +21,7 @@ LL | ::Dyn::func(); | ^^^^^ help: use `dyn`: `` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: trait objects without an explicit `dyn` are deprecated --> $DIR/bare-trait-objects-path.rs:20:5 @@ -30,7 +30,7 @@ LL | Dyn::CONST; | ^^^ help: use `dyn`: `` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: aborting due to previous error; 3 warnings emitted diff --git a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr index 185c0e8e3d0eb..c1ebdb9514bd4 100644 --- a/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr +++ b/src/test/ui/lint/force-warn/force-lint-in-allowed-group.stderr @@ -6,7 +6,7 @@ LL | pub fn function(_x: Box) {} | = note: requested on the command line with `--force-warn bare-trait-objects` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr index a89970587751d..8514956af743e 100644 --- a/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr +++ b/src/test/ui/lint/force-warn/force-warn-cap-lints-allow.stderr @@ -6,7 +6,7 @@ LL | pub fn function(_x: Box) {} | = note: requested on the command line with `--force-warn bare-trait-objects` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr index 1d5f88086c5c4..3a0227463e69a 100644 --- a/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr +++ b/src/test/ui/lint/force-warn/force-warn-cap-lints-warn.stderr @@ -6,7 +6,7 @@ LL | 0...100 => true, | = note: `--force-warn ellipsis-inclusive-range-patterns` implied by `--force-warn rust-2021-compatibility` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr index d242ef266b8d1..29eba6d635f93 100644 --- a/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr +++ b/src/test/ui/lint/force-warn/force-warn-group-allow-warning.stderr @@ -6,7 +6,7 @@ LL | pub fn function(_x: Box) {} | = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: 1 warning emitted diff --git a/src/test/ui/lint/force-warn/force-warn-group.stderr b/src/test/ui/lint/force-warn/force-warn-group.stderr index 180dff880a658..54bee452cddad 100644 --- a/src/test/ui/lint/force-warn/force-warn-group.stderr +++ b/src/test/ui/lint/force-warn/force-warn-group.stderr @@ -6,7 +6,7 @@ LL | pub fn function(_x: Box) {} | = note: `--force-warn bare-trait-objects` implied by `--force-warn rust-2018-idioms` = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: 1 warning emitted diff --git a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr index efa684a24e3d3..91b8d2b5afc77 100644 --- a/src/test/ui/lint/inclusive-range-pattern-syntax.stderr +++ b/src/test/ui/lint/inclusive-range-pattern-syntax.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: `...` range patterns are deprecated --> $DIR/inclusive-range-pattern-syntax.rs:16:9 @@ -19,7 +19,7 @@ LL | &1...2 => {} | ^^^^^^ help: use `..=` for an inclusive range: `&(1..=2)` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: 2 warnings emitted diff --git a/src/test/ui/macros/macro-or-patterns-back-compat.stderr b/src/test/ui/macros/macro-or-patterns-back-compat.stderr index eb6204fa02e69..9a5b8009f32cd 100644 --- a/src/test/ui/macros/macro-or-patterns-back-compat.stderr +++ b/src/test/ui/macros/macro-or-patterns-back-compat.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![deny(rust_2021_incompatible_or_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #84869 + = note: for more information, see error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro --> $DIR/macro-or-patterns-back-compat.rs:13:23 @@ -19,7 +19,7 @@ LL | macro_rules! bar { ($($x:pat)+ | $($y:pat)+) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #84869 + = note: for more information, see error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro --> $DIR/macro-or-patterns-back-compat.rs:19:21 @@ -28,7 +28,7 @@ LL | macro_rules! ogg { ($x:pat | $y:pat_param) => {} } | ^^^^^^ help: use pat_param to preserve semantics: `$x:pat_param` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #84869 + = note: for more information, see error: the meaning of the `pat` fragment specifier is changing in Rust 2021, which may affect this macro --> $DIR/macro-or-patterns-back-compat.rs:23:26 @@ -37,7 +37,7 @@ LL | ( $expr:expr , $( $( $pat:pat )|+ => $expr_arm:expr ),+ ) => { | ^^^^^^^^ help: use pat_param to preserve semantics: `$pat:pat_param` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #84869 + = note: for more information, see error: aborting due to 4 previous errors diff --git a/src/test/ui/parser/issue-68890-2.stderr b/src/test/ui/parser/issue-68890-2.stderr index dce03e1a9635c..1a64b9a017d51 100644 --- a/src/test/ui/parser/issue-68890-2.stderr +++ b/src/test/ui/parser/issue-68890-2.stderr @@ -12,7 +12,7 @@ LL | type X<'a> = (?'a) +; | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0224]: at least one trait is required for an object type --> $DIR/issue-68890-2.rs:3:14 diff --git a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr index c10037d44e30d..6f26f36e76315 100644 --- a/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr +++ b/src/test/ui/parser/issue-73568-lifetime-after-mut.stderr @@ -35,7 +35,7 @@ LL | fn y<'a>(y: &mut 'a + Send) { | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-73568-lifetime-after-mut.rs:19:23 @@ -44,7 +44,7 @@ LL | let z = y as &mut 'a + Send; | ^^ help: use `dyn`: `dyn 'a` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0224]: at least one trait is required for an object type --> $DIR/issue-73568-lifetime-after-mut.rs:14:18 diff --git a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr index caca84f695d76..876bfd389cb5d 100644 --- a/src/test/ui/parser/macro/trait-object-macro-matcher.stderr +++ b/src/test/ui/parser/macro/trait-object-macro-matcher.stderr @@ -12,7 +12,7 @@ LL | m!('static); | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0224]: at least one trait is required for an object type --> $DIR/trait-object-macro-matcher.rs:11:8 diff --git a/src/test/ui/parser/recover-range-pats.stderr b/src/test/ui/parser/recover-range-pats.stderr index 2d8088432a257..762066825db29 100644 --- a/src/test/ui/parser/recover-range-pats.stderr +++ b/src/test/ui/parser/recover-range-pats.stderr @@ -205,7 +205,7 @@ note: the lint level is defined here LL | #![deny(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:45:13 @@ -214,7 +214,7 @@ LL | if let 0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:48:13 @@ -223,7 +223,7 @@ LL | if let X...3 = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:51:13 @@ -232,7 +232,7 @@ LL | if let X...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:54:16 @@ -241,7 +241,7 @@ LL | if let true...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:57:13 @@ -250,7 +250,7 @@ LL | if let X...true = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:60:14 @@ -259,7 +259,7 @@ LL | if let .0...Y = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:64:13 @@ -268,7 +268,7 @@ LL | if let X... .0 = 0 {} | ^^^ help: use `..=` for an inclusive range | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: `...` range patterns are deprecated --> $DIR/recover-range-pats.rs:138:20 @@ -280,7 +280,7 @@ LL | mac2!(0, 1); | ------------ in this macro invocation | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see = note: this error originates in the macro `mac2` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0029]: only `char` and numeric types are allowed in range patterns diff --git a/src/test/ui/parser/trait-object-trait-parens.stderr b/src/test/ui/parser/trait-object-trait-parens.stderr index 9bfc4943fe941..b39fe4646a3cc 100644 --- a/src/test/ui/parser/trait-object-trait-parens.stderr +++ b/src/test/ui/parser/trait-object-trait-parens.stderr @@ -24,7 +24,7 @@ LL | let _: Box<(Obj) + (?Sized) + (for<'a> Trait<'a>)>; | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: trait objects without an explicit `dyn` are deprecated --> $DIR/trait-object-trait-parens.rs:13:16 @@ -33,7 +33,7 @@ LL | let _: Box Trait<'a>) + (Obj)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn ?Sized + (for<'a> Trait<'a>) + (Obj)` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see warning: trait objects without an explicit `dyn` are deprecated --> $DIR/trait-object-trait-parens.rs:18:16 @@ -42,7 +42,7 @@ LL | let _: Box Trait<'a> + (Obj) + (?Sized)>; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use `dyn`: `dyn for<'a> Trait<'a> + (Obj) + (?Sized)` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0225]: only auto traits can be used as additional traits in a trait object --> $DIR/trait-object-trait-parens.rs:8:35 diff --git a/src/test/ui/issues/issue-13641.rs b/src/test/ui/privacy/issue-13641.rs similarity index 100% rename from src/test/ui/issues/issue-13641.rs rename to src/test/ui/privacy/issue-13641.rs diff --git a/src/test/ui/issues/issue-13641.stderr b/src/test/ui/privacy/issue-13641.stderr similarity index 100% rename from src/test/ui/issues/issue-13641.stderr rename to src/test/ui/privacy/issue-13641.stderr diff --git a/src/test/ui/range/range-inclusive-pattern-precedence.stderr b/src/test/ui/range/range-inclusive-pattern-precedence.stderr index 3330ced1ebf34..8af1a570253a2 100644 --- a/src/test/ui/range/range-inclusive-pattern-precedence.stderr +++ b/src/test/ui/range/range-inclusive-pattern-precedence.stderr @@ -16,7 +16,7 @@ note: the lint level is defined here LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr index 90a4aa68222f6..009273c74350b 100644 --- a/src/test/ui/range/range-inclusive-pattern-precedence2.stderr +++ b/src/test/ui/range/range-inclusive-pattern-precedence2.stderr @@ -16,7 +16,7 @@ note: the lint level is defined here LL | #![warn(ellipsis_inclusive_range_patterns)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/rust-2021/future-prelude-collision-generic.stderr b/src/test/ui/rust-2021/future-prelude-collision-generic.stderr index 2c6a63df42f2c..0a722baa185cd 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-generic.stderr +++ b/src/test/ui/rust-2021/future-prelude-collision-generic.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:31:5 @@ -19,7 +19,7 @@ LL | Generic::::from_iter(1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as MyFromIter>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-generic.rs:34:5 @@ -28,7 +28,7 @@ LL | Generic::<_, _>::from_iter(1); | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as MyFromIter>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: 3 warnings emitted diff --git a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr index 6197587681922..fbda5d61f36dc 100644 --- a/src/test/ui/rust-2021/future-prelude-collision-imported.stderr +++ b/src/test/ui/rust-2021/future-prelude-collision-imported.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:40:22 @@ -19,7 +19,7 @@ LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `crate::m::TryIntoU32::try_into(3u8)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision-imported.rs:53:22 @@ -28,7 +28,7 @@ LL | let _: u32 = 3u8.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `super::m::TryIntoU32::try_into(3u8)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: 3 warnings emitted diff --git a/src/test/ui/rust-2021/future-prelude-collision.stderr b/src/test/ui/rust-2021/future-prelude-collision.stderr index 03b89da00d970..889e66de03f9e 100644 --- a/src/test/ui/rust-2021/future-prelude-collision.stderr +++ b/src/test/ui/rust-2021/future-prelude-collision.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:61:13 @@ -19,7 +19,7 @@ LL | let _ = u32::try_from(3u8).unwrap(); | ^^^^^^^^^^^^^ help: disambiguate the associated function: `::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait-associated function `from_iter` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:66:13 @@ -28,7 +28,7 @@ LL | let _ = >::from_iter(vec![1u8, 2, 3, 4, 5, 6].into_iter()); | ^^^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: ` as FromByteIterator>::from_iter` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:74:18 @@ -37,7 +37,7 @@ LL | let _: u32 = <_>::try_from(3u8).unwrap(); | ^^^^^^^^^^^^^ help: disambiguate the associated function: `<_ as TryFromU8>::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:79:18 @@ -46,7 +46,7 @@ LL | let _: u32 = (&3u8).try_into().unwrap(); | ^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(*(&3u8))` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:84:18 @@ -55,7 +55,7 @@ LL | let _: u32 = 3.0.try_into().unwrap(); | ^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(&3.0)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait method `try_into` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:90:18 @@ -64,7 +64,7 @@ LL | let _: u32 = mut_ptr.try_into().unwrap(); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `TryIntoU32::try_into(mut_ptr as *const _)` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: trait-associated function `try_from` will become ambiguous in Rust 2021 --> $DIR/future-prelude-collision.rs:95:13 @@ -73,7 +73,7 @@ LL | let _ = U32Alias::try_from(3u8).unwrap(); | ^^^^^^^^^^^^^^^^^^ help: disambiguate the associated function: `::try_from` | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: 8 warnings emitted diff --git a/src/test/ui/rust-2021/generic-type-collision.stderr b/src/test/ui/rust-2021/generic-type-collision.stderr index d4999201c27f9..e6ea28d718db8 100644 --- a/src/test/ui/rust-2021/generic-type-collision.stderr +++ b/src/test/ui/rust-2021/generic-type-collision.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: 1 warning emitted diff --git a/src/test/ui/rust-2021/inherent-dyn-collision.stderr b/src/test/ui/rust-2021/inherent-dyn-collision.stderr index 605f9ced9ebb7..77b4c38513281 100644 --- a/src/test/ui/rust-2021/inherent-dyn-collision.stderr +++ b/src/test/ui/rust-2021/inherent-dyn-collision.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![warn(rust_2021_prelude_collisions)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #85684 + = note: for more information, see warning: 1 warning emitted diff --git a/src/test/ui/rust-2021/reserved-prefixes-migration.stderr b/src/test/ui/rust-2021/reserved-prefixes-migration.stderr index 95105f932dcbd..4547290913a52 100644 --- a/src/test/ui/rust-2021/reserved-prefixes-migration.stderr +++ b/src/test/ui/rust-2021/reserved-prefixes-migration.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![warn(rust_2021_prefixes_incompatible_syntax)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #84978 + = note: for more information, see help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | m2!(z "hey"); @@ -23,7 +23,7 @@ LL | m2!(prefix"hey"); | ^^^^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #84978 + = note: for more information, see help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | m2!(prefix "hey"); @@ -36,7 +36,7 @@ LL | m3!(hey#123); | ^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #84978 + = note: for more information, see help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | m3!(hey #123); @@ -49,7 +49,7 @@ LL | m3!(hey#hey); | ^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #84978 + = note: for more information, see help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | m3!(hey #hey); @@ -62,7 +62,7 @@ LL | #name = #kind#value | ^^^^ unknown prefix | = warning: this is accepted in the current edition (Rust 2018) but is a hard error in Rust 2021! - = note: for more information, see issue #84978 + = note: for more information, see help: insert whitespace here to avoid this being parsed as a prefix in Rust 2021 | LL | #name = #kind #value diff --git a/src/test/ui/str/str-escape.rs b/src/test/ui/str/str-escape.rs new file mode 100644 index 0000000000000..0264632fd24a1 --- /dev/null +++ b/src/test/ui/str/str-escape.rs @@ -0,0 +1,11 @@ +// check-pass +fn main() { + let s = "\ + + "; + //~^^^ WARNING multiple lines skipped by escaped newline + let s = "foo\ +   bar + "; + //~^^^ WARNING non-ASCII whitespace symbol '\u{a0}' is not skipped +} diff --git a/src/test/ui/str/str-escape.stderr b/src/test/ui/str/str-escape.stderr new file mode 100644 index 0000000000000..b2501f1a2145f --- /dev/null +++ b/src/test/ui/str/str-escape.stderr @@ -0,0 +1,21 @@ +warning: multiple lines skipped by escaped newline + --> $DIR/str-escape.rs:3:14 + | +LL | let s = "\ + | ______________^ +LL | | +LL | | "; + | |_____________^ skipping everything up to and including this point + +warning: non-ASCII whitespace symbol '\u{a0}' is not skipped + --> $DIR/str-escape.rs:7:17 + | +LL | let s = "foo\ + | _________________^ +LL | |   bar + | | ^ non-ASCII whitespace symbol '\u{a0}' is not skipped + | |___| + | + +warning: 2 warnings emitted + diff --git a/src/test/ui/suggestions/issue-61963.stderr b/src/test/ui/suggestions/issue-61963.stderr index 6282a693855af..bb487920e3bb6 100644 --- a/src/test/ui/suggestions/issue-61963.stderr +++ b/src/test/ui/suggestions/issue-61963.stderr @@ -10,7 +10,7 @@ note: the lint level is defined here LL | #![deny(bare_trait_objects)] | ^^^^^^^^^^^^^^^^^^ = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-61963.rs:18:1 @@ -19,7 +19,7 @@ LL | pub struct Foo { | ^^^ help: use `dyn`: `dyn pub` | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/bound/not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr index e65b8989e0b1e..5a64804c4259e 100644 --- a/src/test/ui/traits/bound/not-on-bare-trait.stderr +++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr @@ -6,7 +6,7 @@ LL | fn foo(_x: Foo + Send) { | = note: `#[warn(bare_trait_objects)]` on by default = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! - = note: for more information, see issue #80165 + = note: for more information, see error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time --> $DIR/not-on-bare-trait.rs:7:8 diff --git a/src/tools/cargo b/src/tools/cargo index cc17afbb0067b..b51439fd8b505 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit cc17afbb0067b1f57d8882640f63b2168d5b7624 +Subproject commit b51439fd8b505d4800a257acfecf3c69f81e35cf diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 66d05d9f00ee9..46b5b877b4c26 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -8,7 +8,7 @@ use std::path::Path; const ENTRY_LIMIT: usize = 1000; // FIXME: The following limits should be reduced eventually. const ROOT_ENTRY_LIMIT: usize = 1345; -const ISSUES_ENTRY_LIMIT: usize = 2530; +const ISSUES_ENTRY_LIMIT: usize = 2525; fn check_entries(path: &Path, bad: &mut bool) { let dirs = walkdir::WalkDir::new(&path.join("test/ui"))