diff options
Diffstat (limited to 'src')
42 files changed, 225 insertions, 141 deletions
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs index 4967bf50b48..4ccdabe4bb6 100644 --- a/src/bootstrap/compile.rs +++ b/src/bootstrap/compile.rs @@ -464,7 +464,7 @@ fn copy_sanitizers( builder.copy(&runtime.path, &dst); if target == "x86_64-apple-darwin" || target == "aarch64-apple-darwin" { - // Update the library’s install name to reflect that it has has been renamed. + // Update the library’s install name to reflect that it has been renamed. apple_darwin_update_library_name(&dst, &format!("@rpath/{}", &runtime.name)); // Upon renaming the install name, the code signature of the file will invalidate, // so we will sign it again. diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 7f82dfbd3d6..5f674ed7441 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -1514,7 +1514,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T // as we currently do not supply the parent generics to anonymous constants // but do allow `ConstKind::Param`. // - // `const_eval_poly` tries to to first substitute generic parameters which + // `const_eval_poly` tries to first substitute generic parameters which // results in an ICE while manually constructing the constant and using `eval` // does nothing for `ConstKind::Param`. let ct = ty::Const::from_anon_const(cx.tcx, def_id); diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 943a074366e..7d00002d05b 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -612,7 +612,7 @@ fn generate_macro_def_id_path( }; if path.len() < 2 { // The minimum we can have is the crate name followed by the macro name. If shorter, then - // it means that that `relative` was empty, which is an error. + // it means that `relative` was empty, which is an error. debug!("macro path cannot be empty!"); return Err(HrefError::NotInExternalCache); } diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 5958b389c9f..7989c521774 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -808,9 +808,6 @@ table, height: 34px; margin-top: 4px; } -.search-container > * { - height: 100%; -} .search-results-title { margin-top: 0; white-space: nowrap; @@ -1089,8 +1086,55 @@ so that we can apply CSS-filters to change the arrow color in themes */ color: var(--right-side-color); } +pre.rust { + tab-size: 4; + -moz-tab-size: 4; +} + +/* Code highlighting */ +pre.rust .kw { + color: var(--code-highlight-kw-color); +} +pre.rust .kw-2 { + color: var(--code-highlight-kw-2-color); +} +pre.rust .lifetime { + color: var(--code-highlight-lifetime-color); +} +pre.rust .prelude-ty { + color: var(--code-highlight-prelude-color); +} +pre.rust .prelude-val { + color: var(--code-highlight-prelude-val-color); +} +pre.rust .string { + color: var(--code-highlight-string-color); +} +pre.rust .number { + color: var(--code-highlight-number-color); +} +pre.rust .bool-val { + color: var(--code-highlight-literal-color); +} +pre.rust .self { + color: var(--code-highlight-self-color); +} +pre.rust .attribute { + color: var(--code-highlight-attribute-color); +} +pre.rust .macro, +pre.rust .macro-nonterminal { + color: var(--code-highlight-macro-color); +} pre.rust .question-mark { font-weight: bold; + color: var(--code-highlight-question-mark-color); +} +pre.rust .comment { + color: var(--code-highlight-comment-color); +} +pre.rust .doccomment { + color: var(--code-highlight-doc-comment-color); } .example-wrap.compile_fail, @@ -1296,11 +1340,6 @@ h3.variant { font-size: 1.25rem; } -pre.rust { - tab-size: 4; - -moz-tab-size: 4; -} - .search-failed { text-align: center; margin-top: 20px; diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index fc7713b9885..ee74f81926a 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -41,6 +41,20 @@ Original by Dempfi (https://github.com/dempfi/ayu) --stab-background-color: #314559; --stab-code-color: #e6e1cf; --search-color: #fff; + --code-highlight-kw-color: #ff7733; + --code-highlight-kw-2-color: #ff7733; + --code-highlight-lifetime-color: #ff7733; + --code-highlight-prelude-color: #69f2df; + --code-highlight-prelude-val-color: #ff7733; + --code-highlight-number-color: #b8cc52; + --code-highlight-string-color: #b8cc52; + --code-highlight-literal-color: #ff7733; + --code-highlight-attribute-color: #e6e1cf; + --code-highlight-self-color: #36a3d9; + --code-highlight-macro-color: #a37acc; + --code-highlight-question-mark-color: #ff9011; + --code-highlight-comment-color: #788797; + --code-highlight-doc-comment-color: #a1ac88; } .slider { @@ -124,9 +138,6 @@ pre, .rustdoc.source .example-wrap { .content .item-info::before { color: #ccc; } -pre.rust .comment { color: #788797; } -pre.rust .doccomment { color: #a1ac88; } - .sidebar h2 a, .sidebar h3 a { color: white; @@ -161,23 +172,6 @@ details.rustdoc-toggle > summary::before { .src-line-numbers :target { background-color: transparent; } -/* Code highlighting */ -pre.rust .number, pre.rust .string { color: #b8cc52; } -pre.rust .kw, pre.rust .kw-2, pre.rust .prelude-ty, -pre.rust .bool-val, pre.rust .prelude-val, -pre.rust .lifetime { color: #ff7733; } -pre.rust .macro, pre.rust .macro-nonterminal { color: #a37acc; } -pre.rust .question-mark { - color: #ff9011; -} -pre.rust .self { - color: #36a3d9; - font-style: italic; -} -pre.rust .attribute { - color: #e6e1cf; -} - pre.example-line-numbers { color: #5c67736e; border: none; diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index ee2a9ec8a0b..06baceca01d 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -36,6 +36,20 @@ --stab-background-color: #314559; --stab-code-color: #e6e1cf; --search-color: #111; + --code-highlight-kw-color: #ab8ac1; + --code-highlight-kw-2-color: #769acb; + --code-highlight-lifetime-color: #d97f26; + --code-highlight-prelude-color: #769acb; + --code-highlight-prelude-val-color: #ee6868; + --code-highlight-number-color: #83a300; + --code-highlight-string-color: #83a300; + --code-highlight-literal-color: #ee6868; + --code-highlight-attribute-color: #ee6868; + --code-highlight-self-color: #ee6868; + --code-highlight-macro-color: #3e999f; + --code-highlight-question-mark-color: #ff9011; + --code-highlight-comment-color: #8d8d8b; + --code-highlight-doc-comment-color: #8ca375; } .slider { @@ -62,9 +76,6 @@ input:focus + .slider { .content .item-info::before { color: #ccc; } -pre.rust .comment { color: #8d8d8b; } -pre.rust .doccomment { color: #8ca375; } - body.source .example-wrap pre.rust a { background: #333; } @@ -86,18 +97,6 @@ details.rustdoc-toggle > summary::before { .src-line-numbers :target { background-color: transparent; } -/* Code highlighting */ -pre.rust .kw { color: #ab8ac1; } -pre.rust .kw-2, pre.rust .prelude-ty { color: #769acb; } -pre.rust .number, pre.rust .string { color: #83a300; } -pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, -pre.rust .attribute { color: #ee6868; } -pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } -pre.rust .lifetime { color: #d97f26; } -pre.rust .question-mark { - color: #ff9011; -} - pre.example-line-numbers { border-color: #4a4949; } diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index 7287d5b6212..058974c078c 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -36,6 +36,20 @@ --stab-background-color: #fff5d6; --stab-code-color: #000; --search-color: #000; + --code-highlight-kw-color: #8959a8; + --code-highlight-kw-2-color: #4271ae; + --code-highlight-lifetime-color: #b76514; + --code-highlight-prelude-color: #4271ae; + --code-highlight-prelude-val-color: #c82829; + --code-highlight-number-color: #718c00; + --code-highlight-string-color: #718c00; + --code-highlight-literal-color: #c82829; + --code-highlight-attribute-color: #c82829; + --code-highlight-self-color: #c82829; + --code-highlight-macro-color: #3e999f; + --code-highlight-question-mark-color: #ff9011; + --code-highlight-comment-color: #8e908c; + --code-highlight-doc-comment-color: #4d4d4c; } .slider { @@ -78,20 +92,6 @@ body.source .example-wrap pre.rust a { .src-line-numbers :target { background-color: transparent; } -/* Code highlighting */ -pre.rust .kw { color: #8959A8; } -pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; } -pre.rust .number, pre.rust .string { color: #718C00; } -pre.rust .self, pre.rust .bool-val, pre.rust .prelude-val, -pre.rust .attribute { color: #C82829; } -pre.rust .comment { color: #8E908C; } -pre.rust .doccomment { color: #4D4D4C; } -pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; } -pre.rust .lifetime { color: #B76514; } -pre.rust .question-mark { - color: #ff9011; -} - pre.example-line-numbers { border-color: #c7c7c7; } diff --git a/src/test/codegen/vec-in-place.rs b/src/test/codegen/vec-in-place.rs index 62139aa9beb..5df3669056d 100644 --- a/src/test/codegen/vec-in-place.rs +++ b/src/test/codegen/vec-in-place.rs @@ -17,7 +17,7 @@ pub struct Foo { // Going from an aggregate struct to another type currently requires Copy to // enable the TrustedRandomAccess specialization. Without it optimizations do not yet -// reliably recognize the loops as noop for for repr(C) or non-Copy structs. +// reliably recognize the loops as noop for repr(C) or non-Copy structs. #[derive(Copy, Clone)] pub struct Bar { a: u64, diff --git a/src/test/rustdoc-gui/highlight-colors.goml b/src/test/rustdoc-gui/highlight-colors.goml new file mode 100644 index 00000000000..dd01dbf6148 --- /dev/null +++ b/src/test/rustdoc-gui/highlight-colors.goml @@ -0,0 +1,57 @@ +// This test checks the highlight colors in the source code pages. +goto: "file://" + |DOC_PATH| + "/src/test_docs/lib.rs.html" +show-text: true + +local-storage: {"rustdoc-theme": "ayu", "rustdoc-use-system-theme": "false"} +reload: + +assert-css: ("pre.rust .kw", {"color": "rgb(255, 119, 51)"}, ALL) +assert-css: ("pre.rust .kw-2", {"color": "rgb(255, 119, 51)"}, ALL) +assert-css: ("pre.rust .prelude-ty", {"color": "rgb(105, 242, 223)"}, ALL) +assert-css: ("pre.rust .prelude-val", {"color": "rgb(255, 119, 51)"}, ALL) +assert-css: ("pre.rust .lifetime", {"color": "rgb(255, 119, 51)"}, ALL) +assert-css: ("pre.rust .number", {"color": "rgb(184, 204, 82)"}, ALL) +assert-css: ("pre.rust .string", {"color": "rgb(184, 204, 82)"}, ALL) +assert-css: ("pre.rust .bool-val", {"color": "rgb(255, 119, 51)"}, ALL) +assert-css: ("pre.rust .self", {"color": "rgb(54, 163, 217)"}, ALL) +assert-css: ("pre.rust .attribute", {"color": "rgb(230, 225, 207)"}, ALL) +assert-css: ("pre.rust .macro", {"color": "rgb(163, 122, 204)"}, ALL) +assert-css: ("pre.rust .question-mark", {"color": "rgb(255, 144, 17)"}, ALL) +assert-css: ("pre.rust .comment", {"color": "rgb(120, 135, 151)"}, ALL) +assert-css: ("pre.rust .doccomment", {"color": "rgb(161, 172, 136)"}, ALL) + +local-storage: {"rustdoc-theme": "dark"} +reload: + +assert-css: ("pre.rust .kw", {"color": "rgb(171, 138, 193)"}, ALL) +assert-css: ("pre.rust .kw-2", {"color": "rgb(118, 154, 203)"}, ALL) +assert-css: ("pre.rust .prelude-ty", {"color": "rgb(118, 154, 203)"}, ALL) +assert-css: ("pre.rust .prelude-val", {"color": "rgb(238, 104, 104)"}, ALL) +assert-css: ("pre.rust .lifetime", {"color": "rgb(217, 127, 38)"}, ALL) +assert-css: ("pre.rust .number", {"color": "rgb(131, 163, 0)"}, ALL) +assert-css: ("pre.rust .string", {"color": "rgb(131, 163, 0)"}, ALL) +assert-css: ("pre.rust .bool-val", {"color": "rgb(238, 104, 104)"}, ALL) +assert-css: ("pre.rust .self", {"color": "rgb(238, 104, 104)"}, ALL) +assert-css: ("pre.rust .attribute", {"color": "rgb(238, 104, 104)"}, ALL) +assert-css: ("pre.rust .macro", {"color": "rgb(62, 153, 159)"}, ALL) +assert-css: ("pre.rust .question-mark", {"color": "rgb(255, 144, 17)"}, ALL) +assert-css: ("pre.rust .comment", {"color": "rgb(141, 141, 139)"}, ALL) +assert-css: ("pre.rust .doccomment", {"color": "rgb(140, 163, 117)"}, ALL) + +local-storage: {"rustdoc-theme": "light"} +reload: + +assert-css: ("pre.rust .kw", {"color": "rgb(137, 89, 168)"}, ALL) +assert-css: ("pre.rust .kw-2", {"color": "rgb(66, 113, 174)"}, ALL) +assert-css: ("pre.rust .prelude-ty", {"color": "rgb(66, 113, 174)"}, ALL) +assert-css: ("pre.rust .prelude-val", {"color": "rgb(200, 40, 41)"}, ALL) +assert-css: ("pre.rust .lifetime", {"color": "rgb(183, 101, 20)"}, ALL) +assert-css: ("pre.rust .number", {"color": "rgb(113, 140, 0)"}, ALL) +assert-css: ("pre.rust .string", {"color": "rgb(113, 140, 0)"}, ALL) +assert-css: ("pre.rust .bool-val", {"color": "rgb(200, 40, 41)"}, ALL) +assert-css: ("pre.rust .self", {"color": "rgb(200, 40, 41)"}, ALL) +assert-css: ("pre.rust .attribute", {"color": "rgb(200, 40, 41)"}, ALL) +assert-css: ("pre.rust .macro", {"color": "rgb(62, 153, 159)"}, ALL) +assert-css: ("pre.rust .question-mark", {"color": "rgb(255, 144, 17)"}, ALL) +assert-css: ("pre.rust .comment", {"color": "rgb(142, 144, 140)"}, ALL) +assert-css: ("pre.rust .doccomment", {"color": "rgb(77, 77, 76)"}, ALL) diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index 33c74e3a331..cc0efe7231a 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -364,8 +364,23 @@ pub trait TraitWithNoDocblocks { pub struct TypeWithNoDocblocks; impl TypeWithNoDocblocks { + fn x() -> Option<Self> { + Some(Self) + } + fn y() -> Option<u32> { + // code comment + let t = Self::x()?; + Some(0) + } +} + +impl TypeWithNoDocblocks { pub fn first_fn(&self) {} - pub fn second_fn(&self) {} + pub fn second_fn<'a>(&'a self) { + let x = 12; + let y = "a"; + let z = false; + } } pub unsafe fn unsafe_fn() {} diff --git a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr index f4efd131248..0b96a6bd7c0 100644 --- a/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr +++ b/src/test/ui/associated-item/associated-item-duplicate-names-2.stderr @@ -1,11 +1,11 @@ -error[E0201]: duplicate definitions with name `bar`: +error[E0592]: duplicate definitions with name `bar` --> $DIR/associated-item-duplicate-names-2.rs:5:5 | LL | const bar: bool = true; - | --------------- previous definition of `bar` here + | --------------- other definition for `bar` LL | fn bar() {} - | ^^^^^^^^ duplicate definition + | ^^^^^^^^ duplicate definitions for `bar` error: aborting due to previous error -For more information about this error, try `rustc --explain E0201`. +For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/impl-duplicate-methods.rs b/src/test/ui/associated-item/impl-duplicate-methods.rs index adb09d7f56e..328d54d5ac4 100644 --- a/src/test/ui/impl-duplicate-methods.rs +++ b/src/test/ui/associated-item/impl-duplicate-methods.rs @@ -3,7 +3,7 @@ struct Foo; impl Foo { fn orange(&self) {} fn orange(&self) {} - //~^ ERROR duplicate definition + //~^ ERROR duplicate definitions with name `orange` [E0592] } fn main() {} diff --git a/src/test/ui/associated-item/impl-duplicate-methods.stderr b/src/test/ui/associated-item/impl-duplicate-methods.stderr new file mode 100644 index 00000000000..6f753845ac8 --- /dev/null +++ b/src/test/ui/associated-item/impl-duplicate-methods.stderr @@ -0,0 +1,11 @@ +error[E0592]: duplicate definitions with name `orange` + --> $DIR/impl-duplicate-methods.rs:5:5 + | +LL | fn orange(&self) {} + | ---------------- other definition for `orange` +LL | fn orange(&self) {} + | ^^^^^^^^^^^^^^^^ duplicate definitions for `orange` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/issues/issue-17718-static-move.rs b/src/test/ui/borrowck/issue-17718-static-move.rs index 015487a06aa..015487a06aa 100644 --- a/src/test/ui/issues/issue-17718-static-move.rs +++ b/src/test/ui/borrowck/issue-17718-static-move.rs diff --git a/src/test/ui/issues/issue-17718-static-move.stderr b/src/test/ui/borrowck/issue-17718-static-move.stderr index 984534bfb8b..984534bfb8b 100644 --- a/src/test/ui/issues/issue-17718-static-move.stderr +++ b/src/test/ui/borrowck/issue-17718-static-move.stderr diff --git a/src/test/ui/issues/issue-17718-constants-not-static.rs b/src/test/ui/consts/issue-17718-constants-not-static.rs index 2e6aff1618b..2e6aff1618b 100644 --- a/src/test/ui/issues/issue-17718-constants-not-static.rs +++ b/src/test/ui/consts/issue-17718-constants-not-static.rs diff --git a/src/test/ui/issues/issue-17718-constants-not-static.stderr b/src/test/ui/consts/issue-17718-constants-not-static.stderr index 8f3acae7139..8f3acae7139 100644 --- a/src/test/ui/issues/issue-17718-constants-not-static.stderr +++ b/src/test/ui/consts/issue-17718-constants-not-static.stderr diff --git a/src/test/ui/issues/issue-17718-const-destructors.rs b/src/test/ui/drop/issue-17718-const-destructors.rs index c9a729c7b20..c9a729c7b20 100644 --- a/src/test/ui/issues/issue-17718-const-destructors.rs +++ b/src/test/ui/drop/issue-17718-const-destructors.rs diff --git a/src/test/ui/issues/issue-48962.rs b/src/test/ui/drop/issue-48962.rs index 80d815379be..80d815379be 100644 --- a/src/test/ui/issues/issue-48962.rs +++ b/src/test/ui/drop/issue-48962.rs diff --git a/src/test/ui/error-codes/E0201.rs b/src/test/ui/error-codes/E0201.rs index adefd4bcd46..04b37091b2f 100644 --- a/src/test/ui/error-codes/E0201.rs +++ b/src/test/ui/error-codes/E0201.rs @@ -2,7 +2,7 @@ struct Foo(u8); impl Foo { fn bar(&self) -> bool { self.0 > 5 } - fn bar() {} //~ ERROR E0201 + fn bar() {} //~ ERROR E0592 } trait Baz { diff --git a/src/test/ui/error-codes/E0201.stderr b/src/test/ui/error-codes/E0201.stderr index f72145a8244..608ff691776 100644 --- a/src/test/ui/error-codes/E0201.stderr +++ b/src/test/ui/error-codes/E0201.stderr @@ -21,14 +21,15 @@ LL | type Quux = u32; LL | type Quux = u32; | ^^^^^^^^^^^^^^^^ duplicate definition -error[E0201]: duplicate definitions with name `bar`: +error[E0592]: duplicate definitions with name `bar` --> $DIR/E0201.rs:5:5 | LL | fn bar(&self) -> bool { self.0 > 5 } - | --------------------- previous definition of `bar` here + | --------------------- other definition for `bar` LL | fn bar() {} - | ^^^^^^^^ duplicate definition + | ^^^^^^^^ duplicate definitions for `bar` error: aborting due to 3 previous errors -For more information about this error, try `rustc --explain E0201`. +Some errors have detailed explanations: E0201, E0592. +For more information about an error, try `rustc --explain E0201`. diff --git a/src/test/ui/impl-duplicate-methods.stderr b/src/test/ui/impl-duplicate-methods.stderr deleted file mode 100644 index c19702a5bf0..00000000000 --- a/src/test/ui/impl-duplicate-methods.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0201]: duplicate definitions with name `orange`: - --> $DIR/impl-duplicate-methods.rs:5:5 - | -LL | fn orange(&self) {} - | ---------------- previous definition of `orange` here -LL | fn orange(&self) {} - | ^^^^^^^^^^^^^^^^ duplicate definition - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0201`. diff --git a/src/test/ui/issues/issue-4265.stderr b/src/test/ui/issues/issue-4265.stderr index 27e83d49574..8c7303f3c3c 100644 --- a/src/test/ui/issues/issue-4265.stderr +++ b/src/test/ui/issues/issue-4265.stderr @@ -1,12 +1,12 @@ -error[E0201]: duplicate definitions with name `bar`: +error[E0592]: duplicate definitions with name `bar` --> $DIR/issue-4265.rs:10:5 | LL | fn bar() { - | -------- previous definition of `bar` here + | -------- other definition for `bar` ... LL | fn bar() { - | ^^^^^^^^ duplicate definition + | ^^^^^^^^ duplicate definitions for `bar` error: aborting due to previous error -For more information about this error, try `rustc --explain E0201`. +For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/issues/issue-77993-1.rs b/src/test/ui/issues/issue-77993-1.rs deleted file mode 100644 index 515b3bc09f0..00000000000 --- a/src/test/ui/issues/issue-77993-1.rs +++ /dev/null @@ -1,12 +0,0 @@ -#[derive(Clone)] -struct InGroup<F> { - it: It, - //~^ ERROR cannot find type `It` in this scope - f: F, -} -fn dates_in_year() -> impl Clone { - InGroup { f: |d| d } - //~^ ERROR missing field `it` in initializer of `InGroup<_>` -} - -fn main() {} diff --git a/src/test/ui/issues/issue-77993-1.stderr b/src/test/ui/issues/issue-77993-1.stderr deleted file mode 100644 index 3dc78ba6f85..00000000000 --- a/src/test/ui/issues/issue-77993-1.stderr +++ /dev/null @@ -1,16 +0,0 @@ -error[E0412]: cannot find type `It` in this scope - --> $DIR/issue-77993-1.rs:3:9 - | -LL | it: It, - | ^^ not found in this scope - -error[E0063]: missing field `it` in initializer of `InGroup<_>` - --> $DIR/issue-77993-1.rs:8:5 - | -LL | InGroup { f: |d| d } - | ^^^^^^^ missing `it` - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0063, E0412. -For more information about an error, try `rustc --explain E0063`. diff --git a/src/test/ui/let-else/let-else-then-diverge.rs b/src/test/ui/let-else/let-else-then-diverge.rs index 1c8f7d758e8..1a75310c94f 100644 --- a/src/test/ui/let-else/let-else-then-diverge.rs +++ b/src/test/ui/let-else/let-else-then-diverge.rs @@ -1,8 +1,6 @@ -// -// popped up in in #94012, where an alternative desugaring was +// popped up in #94012, where an alternative desugaring was // causing unreachable code errors - #![deny(unused_variables)] #![deny(unreachable_code)] diff --git a/src/test/ui/let-else/let-else-then-diverge.stderr b/src/test/ui/let-else/let-else-then-diverge.stderr index ceb61029d38..470a11d4769 100644 --- a/src/test/ui/let-else/let-else-then-diverge.stderr +++ b/src/test/ui/let-else/let-else-then-diverge.stderr @@ -1,11 +1,11 @@ error: unused variable: `x` - --> $DIR/let-else-then-diverge.rs:11:13 + --> $DIR/let-else-then-diverge.rs:9:13 | LL | let x = 5; | ^ help: if this is intentional, prefix it with an underscore: `_x` | note: the lint level is defined here - --> $DIR/let-else-then-diverge.rs:6:9 + --> $DIR/let-else-then-diverge.rs:4:9 | LL | #![deny(unused_variables)] | ^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/methods/method-macro-backtrace.stderr b/src/test/ui/methods/method-macro-backtrace.stderr index 7ae00835c96..dd616c4a5e7 100644 --- a/src/test/ui/methods/method-macro-backtrace.stderr +++ b/src/test/ui/methods/method-macro-backtrace.stderr @@ -1,11 +1,11 @@ -error[E0201]: duplicate definitions with name `bar`: +error[E0592]: duplicate definitions with name `bar` --> $DIR/method-macro-backtrace.rs:22:5 | LL | fn bar(&self) { } - | ------------- previous definition of `bar` here + | ------------- other definition for `bar` LL | fn bar(&self) { } - | ^^^^^^^^^^^^^ duplicate definition + | ^^^^^^^^^^^^^ duplicate definitions for `bar` error: aborting due to previous error -For more information about this error, try `rustc --explain E0201`. +For more information about this error, try `rustc --explain E0592`. diff --git a/src/test/ui/issues/issue-5500-1.rs b/src/test/ui/never_type/issue-5500-1.rs index 98d6e1a14cb..98d6e1a14cb 100644 --- a/src/test/ui/issues/issue-5500-1.rs +++ b/src/test/ui/never_type/issue-5500-1.rs diff --git a/src/test/ui/issues/issue-17718-parse-const.rs b/src/test/ui/parser/issue-17718-parse-const.rs index d5a5f445d5b..d5a5f445d5b 100644 --- a/src/test/ui/issues/issue-17718-parse-const.rs +++ b/src/test/ui/parser/issue-17718-parse-const.rs diff --git a/src/test/ui/issues/issue-17718-patterns.rs b/src/test/ui/pattern/issue-17718-patterns.rs index 2ca0f67f80e..2ca0f67f80e 100644 --- a/src/test/ui/issues/issue-17718-patterns.rs +++ b/src/test/ui/pattern/issue-17718-patterns.rs diff --git a/src/test/ui/issues/issue-17718-patterns.stderr b/src/test/ui/pattern/issue-17718-patterns.stderr index 109091c2af0..109091c2af0 100644 --- a/src/test/ui/issues/issue-17718-patterns.stderr +++ b/src/test/ui/pattern/issue-17718-patterns.stderr diff --git a/src/test/ui/issues/auxiliary/issue-17718-const-privacy.rs b/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs index 93cf4bf3ecc..93cf4bf3ecc 100644 --- a/src/test/ui/issues/auxiliary/issue-17718-const-privacy.rs +++ b/src/test/ui/privacy/auxiliary/issue-17718-const-privacy.rs diff --git a/src/test/ui/issues/issue-17718-const-privacy.rs b/src/test/ui/privacy/issue-17718-const-privacy.rs index 6ab3a60df87..6ab3a60df87 100644 --- a/src/test/ui/issues/issue-17718-const-privacy.rs +++ b/src/test/ui/privacy/issue-17718-const-privacy.rs diff --git a/src/test/ui/issues/issue-17718-const-privacy.stderr b/src/test/ui/privacy/issue-17718-const-privacy.stderr index 133a6360bf9..133a6360bf9 100644 --- a/src/test/ui/issues/issue-17718-const-privacy.stderr +++ b/src/test/ui/privacy/issue-17718-const-privacy.stderr diff --git a/src/test/ui/proc-macro/call-deprecated.rs b/src/test/ui/proc-macro/call-deprecated.rs index b92cc23638a..cb634671bd4 100644 --- a/src/test/ui/proc-macro/call-deprecated.rs +++ b/src/test/ui/proc-macro/call-deprecated.rs @@ -5,7 +5,7 @@ extern crate call_deprecated; // These first two `#[allow(deprecated)]` attributes // do nothing, since the AST nodes for `First` and `Second` -// haven't been been assigned a `NodeId`. +// haven't been assigned a `NodeId`. // See #63221 for a discussion about how we should // handle the interaction of 'inert' attributes and // proc-macro attributes. diff --git a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr index 2570c36b810..be4a5231558 100644 --- a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr +++ b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.disallowed.stderr @@ -75,26 +75,26 @@ LL | if let first = &opt && let None = Some(1) {} = note: this pattern will always match = help: consider moving it outside of the construct -error: irrefutable `let` patterns +error: irrefutable `if let` guard patterns --> $DIR/irrefutable-lets.rs:44:28 | LL | Some(ref first) if let second = first && let _third = second && let v = 4 + 4 => {}, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: these patterns will always match, so the `let` is useless - = help: consider removing `let` + = note: these patterns will always match, so the guard is useless + = help: consider removing the guard and adding a `let` inside the match arm -error: leading irrefutable pattern in let chain - --> $DIR/irrefutable-lets.rs:50:28 +error: trailing irrefutable patterns in let chain + --> $DIR/irrefutable-lets.rs:59:16 | -LL | Some(ref first) if let Range { start: local_start, end: _ } = first - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | && let v = local_end && let w = v => {}, + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | - = note: this pattern will always match - = help: consider moving it outside of the construct + = note: these patterns will always match + = help: consider moving them into the body error: irrefutable `while let` patterns - --> $DIR/irrefutable-lets.rs:59:11 + --> $DIR/irrefutable-lets.rs:68:11 | LL | while let first = &opt && let (a, b) = (1, 2) {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -103,7 +103,7 @@ LL | while let first = &opt && let (a, b) = (1, 2) {} = help: consider instead using a `loop { ... }` with a `let` inside it error: trailing irrefutable patterns in let chain - --> $DIR/irrefutable-lets.rs:62:40 + --> $DIR/irrefutable-lets.rs:71:40 | LL | while let Some(ref first) = opt && let second = first && let _third = second {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs index 3d1626e8ffb..9afb6853b36 100644 --- a/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs +++ b/src/test/ui/rfc-2497-if-let-chains/irrefutable-lets.rs @@ -42,18 +42,27 @@ fn main() { match opt { Some(ref first) if let second = first && let _third = second && let v = 4 + 4 => {}, - //[disallowed]~^ ERROR irrefutable `let` patterns + //[disallowed]~^ ERROR irrefutable `if let` guard patterns _ => {} } + // No error about leading irrefutable patterns: the expr on the rhs might + // use the bindings created by the match. match opt { Some(ref first) if let Range { start: local_start, end: _ } = first - //[disallowed]~^ ERROR leading irrefutable pattern in let chain && let None = local_start => {}, _ => {} } - // No error, despite the prefix being irrefutable + match opt { + Some(ref first) if let Range { start: Some(_), end: local_end } = first + && let v = local_end && let w = v => {}, + //[disallowed]~^ ERROR trailing irrefutable patterns in let chain + _ => {} + } + + // No error, despite the prefix being irrefutable: moving out could change the behaviour, + // due to possible side effects of the operation. while let first = &opt && let Some(ref second) = first && let None = second.start {} while let first = &opt && let (a, b) = (1, 2) {} diff --git a/src/test/ui/issues/issue-17718-static-sync.rs b/src/test/ui/statics/issue-17718-static-sync.rs index 6f278d76bb1..6f278d76bb1 100644 --- a/src/test/ui/issues/issue-17718-static-sync.rs +++ b/src/test/ui/statics/issue-17718-static-sync.rs diff --git a/src/test/ui/issues/issue-17718-static-sync.stderr b/src/test/ui/statics/issue-17718-static-sync.stderr index bc6e45e5925..bc6e45e5925 100644 --- a/src/test/ui/issues/issue-17718-static-sync.stderr +++ b/src/test/ui/statics/issue-17718-static-sync.stderr diff --git a/src/test/ui/issues/issue-17718-static-unsafe-interior.rs b/src/test/ui/statics/issue-17718-static-unsafe-interior.rs index 65a8713ba05..65a8713ba05 100644 --- a/src/test/ui/issues/issue-17718-static-unsafe-interior.rs +++ b/src/test/ui/statics/issue-17718-static-unsafe-interior.rs diff --git a/src/tools/tidy/src/ui_tests.rs b/src/tools/tidy/src/ui_tests.rs index 052abfdab5d..3815259c9aa 100644 --- a/src/tools/tidy/src/ui_tests.rs +++ b/src/tools/tidy/src/ui_tests.rs @@ -7,8 +7,8 @@ use std::path::Path; const ENTRY_LIMIT: usize = 1000; // FIXME: The following limits should be reduced eventually. -const ROOT_ENTRY_LIMIT: usize = 950; -const ISSUES_ENTRY_LIMIT: usize = 2141; +const ROOT_ENTRY_LIMIT: usize = 948; +const ISSUES_ENTRY_LIMIT: usize = 2126; fn check_entries(path: &Path, bad: &mut bool) { let dirs = walkdir::WalkDir::new(&path.join("test/ui")) |
