diff options
Diffstat (limited to 'src/test')
45 files changed, 1369 insertions, 403 deletions
diff --git a/src/test/assembly/x86-stack-probes.rs b/src/test/assembly/x86-stack-probes.rs new file mode 100644 index 00000000000..c7141fb208a --- /dev/null +++ b/src/test/assembly/x86-stack-probes.rs @@ -0,0 +1,42 @@ +// min-llvm-version: 16 +// revisions: x86_64 i686 +// assembly-output: emit-asm +//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//[x86_64] needs-llvm-components: x86 +//[i686] compile-flags: --target i686-unknown-linux-gnu +//[i686] needs-llvm-components: x86 +// compile-flags: -C llvm-args=-x86-asm-syntax=intel + +#![feature(no_core, lang_items)] +#![crate_type = "lib"] +#![no_core] + +#[lang = "sized"] +trait Sized {} +#[lang = "copy"] +trait Copy {} + +impl Copy for u8 {} + +// Check that inline-asm stack probes are generated correctly. +// To avoid making this test fragile to slight asm changes, +// we only check that the stack pointer is decremented by a page at a time, +// instead of matching the whole probe sequence. + +// CHECK-LABEL: small_stack_probe: +#[no_mangle] +pub fn small_stack_probe(x: u8, f: fn(&mut [u8; 8192])) { + // CHECK-NOT: __rust_probestack + // x86_64: sub rsp, 4096 + // i686: sub esp, 4096 + f(&mut [x; 8192]); +} + +// CHECK-LABEL: big_stack_probe: +#[no_mangle] +pub fn big_stack_probe(x: u8, f: fn(&[u8; 65536])) { + // CHECK-NOT: __rust_probestack + // x86_64: sub rsp, 4096 + // i686: sub esp, 4096 + f(&mut [x; 65536]); +} diff --git a/src/test/codegen/stack-probes-call.rs b/src/test/codegen/stack-probes-call.rs index 56b02fdecad..a18fd41c28c 100644 --- a/src/test/codegen/stack-probes-call.rs +++ b/src/test/codegen/stack-probes-call.rs @@ -5,8 +5,10 @@ // revisions: i686 x86_64 //[i686] compile-flags: --target i686-unknown-linux-gnu //[i686] needs-llvm-components: x86 +//[i686] ignore-llvm-version: 16 - 99 //[x86_64] compile-flags: --target x86_64-unknown-linux-gnu //[x86_64] needs-llvm-components: x86 +//[x86_64] ignore-llvm-version: 16 - 99 #![crate_type = "rlib"] #![feature(no_core, lang_items)] diff --git a/src/test/codegen/stack-probes-inline.rs b/src/test/codegen/stack-probes-inline.rs index 837a1610810..a6b781de531 100644 --- a/src/test/codegen/stack-probes-inline.rs +++ b/src/test/codegen/stack-probes-inline.rs @@ -2,7 +2,7 @@ // or `StackProbeType::InlineOrCall` when running on newer LLVM. // compile-flags: -C no-prepopulate-passes -// revisions: powerpc powerpc64 powerpc64le s390x +// revisions: powerpc powerpc64 powerpc64le s390x i686 x86_64 //[powerpc] compile-flags: --target powerpc-unknown-linux-gnu //[powerpc] needs-llvm-components: powerpc //[powerpc64] compile-flags: --target powerpc64-unknown-linux-gnu @@ -11,6 +11,12 @@ //[powerpc64le] needs-llvm-components: powerpc //[s390x] compile-flags: --target s390x-unknown-linux-gnu //[s390x] needs-llvm-components: systemz +//[i686] compile-flags: --target i686-unknown-linux-gnu +//[i686] needs-llvm-components: x86 +//[i686] min-llvm-version: 16 +//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu +//[x86_64] needs-llvm-components: x86 +//[x86_64] min-llvm-version: 16 #![crate_type = "rlib"] #![feature(no_core, lang_items)] diff --git a/src/test/rustdoc-gui/search-result-color.goml b/src/test/rustdoc-gui/search-result-color.goml index c4b5fdf53dd..807646cce37 100644 --- a/src/test/rustdoc-gui/search-result-color.goml +++ b/src/test/rustdoc-gui/search-result-color.goml @@ -30,54 +30,243 @@ assert-css: ( // Checking the color of "keyword". assert-css: ( - ".result-name .keyword", + ".result-keyword .keyword", {"color": "rgb(57, 175, 215)"}, ALL, ) +assert-css: ( + ".result-keyword", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-keyword" +assert-css: ( + ".result-keyword:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-keyword:hover .keyword", + {"color": "rgb(57, 175, 215)"}, +) +move-cursor-to: ".search-input" +focus: ".result-keyword" +assert-css: ( + ".result-keyword:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-keyword:focus .keyword", + {"color": "rgb(57, 175, 215)"}, +) + // Check the color of "struct". assert-css: ( - ".result-name .struct", + ".result-struct .struct", {"color": "rgb(255, 160, 165)"}, ALL, ) +assert-css: ( + ".result-struct", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-struct" +assert-css: ( + ".result-struct:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-struct:hover .struct", + {"color": "rgb(255, 160, 165)"}, +) +move-cursor-to: ".search-input" +focus: ".result-struct" +assert-css: ( + ".result-struct:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-struct:focus .struct", + {"color": "rgb(255, 160, 165)"}, +) + // Check the color of "associated type". assert-css: ( - ".result-name .associatedtype", + ".result-associatedtype .associatedtype", {"color": "rgb(57, 175, 215)"}, ALL, ) +assert-css: ( + ".result-associatedtype", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-associatedtype" +assert-css: ( + ".result-associatedtype:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-associatedtype:hover .associatedtype", + {"color": "rgb(57, 175, 215)"}, +) +move-cursor-to: ".search-input" +focus: ".result-associatedtype" +assert-css: ( + ".result-associatedtype:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-associatedtype:focus .associatedtype", + {"color": "rgb(57, 175, 215)"}, +) + // Check the color of "type method". assert-css: ( - ".result-name .tymethod", + ".result-tymethod .tymethod", {"color": "rgb(253, 214, 135)"}, ALL, ) +assert-css: ( + ".result-tymethod", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +assert-css: ( + ".result-tymethod .tymethod", + {"color": "rgb(253, 214, 135)"}, +) +move-cursor-to: ".result-tymethod" +assert-css: ( + ".result-tymethod:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +move-cursor-to: ".search-input" +focus: ".result-tymethod" +assert-css: ( + ".result-tymethod:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) + // Check the color of "method". assert-css: ( - ".result-name .method", + ".result-method .method", {"color": "rgb(253, 214, 135)"}, ALL, ) +assert-css: ( + ".result-method", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-method" +assert-css: ( + ".result-method:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-method:hover .method", + {"color": "rgb(253, 214, 135)"}, +) +move-cursor-to: ".search-input" +focus: ".result-method" +assert-css: ( + ".result-method:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-method:focus .method", + {"color": "rgb(253, 214, 135)"}, +) + // Check the color of "struct field". assert-css: ( - ".result-name .structfield", + ".result-structfield .structfield", {"color": "rgb(0, 150, 207)"}, ALL, ) +assert-css: ( + ".result-structfield", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-structfield" +assert-css: ( + ".result-structfield:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-structfield:hover .structfield", + {"color": "rgb(255, 255, 255)"}, +) +move-cursor-to: ".search-input" +focus: ".result-structfield" +assert-css: ( + ".result-structfield:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-structfield:focus .structfield", + {"color": "rgb(255, 255, 255)"}, +) + // Check the color of "macro". assert-css: ( - ".result-name .macro", + ".result-macro .macro", {"color": "rgb(163, 122, 204)"}, ALL, ) +assert-css: ( + ".result-macro", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-macro" +assert-css: ( + ".result-macro:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-macro:hover .macro", + {"color": "rgb(163, 122, 204)"}, +) +move-cursor-to: ".search-input" +focus: ".result-macro" +assert-css: ( + ".result-macro:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-macro:focus .macro", + {"color": "rgb(163, 122, 204)"}, +) + // Check the color of "fn". assert-css: ( - ".result-name .fn", + ".result-fn .fn", {"color": "rgb(253, 214, 135)"}, ALL, ) +assert-css: ( + ".result-fn", + {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-fn" +assert-css: ( + ".result-fn:hover", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-fn:hover .fn", + {"color": "rgb(253, 214, 135)"}, +) +move-cursor-to: ".search-input" +focus: ".result-fn" +assert-css: ( + ".result-fn:focus", + {"color": "rgb(255, 255, 255)", "background-color": "rgb(60, 60, 60)"}, +) +assert-css: ( + ".result-fn:focus .fn", + {"color": "rgb(253, 214, 135)"}, +) // Checking the `<a>` container. +move-cursor-to: ".search-input" +focus: ".search-input" // To ensure the `<a>` container isnt focus or hover. assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", {"color": "rgb(0, 150, 207)", "background-color": "rgba(0, 0, 0, 0)"}, @@ -113,7 +302,7 @@ assert-css: ( {"color": "rgb(221, 221, 221)"}, ) -// Checking the color for "keyword". +// Checking the color for "keyword" text. assert-css: ( "//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(221, 221, 221)"}, @@ -121,68 +310,250 @@ assert-css: ( // Checking the color of "keyword". assert-css: ( - ".result-name .keyword", + ".result-keyword .keyword", {"color": "rgb(210, 153, 29)"}, ALL, ) +assert-css: ( + ".result-keyword", + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-keyword" +assert-css: ( + ".result-keyword:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-keyword:hover .keyword", + {"color": "rgb(210, 153, 29)"}, +) +move-cursor-to: ".search-input" +focus: ".result-keyword" +assert-css: ( + ".result-keyword:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-keyword:focus .keyword", + {"color": "rgb(210, 153, 29)"}, +) + // Check the color of "struct". assert-css: ( - ".result-name .struct", + ".result-struct .struct", {"color": "rgb(45, 191, 184)"}, ALL, ) +assert-css: ( + ".result-struct", + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-struct" +assert-css: ( + ".result-struct:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-struct:hover .struct", + {"color": "rgb(45, 191, 184)"}, +) +move-cursor-to: ".search-input" +focus: ".result-struct" +assert-css: ( + ".result-struct:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-struct:focus .struct", + {"color": "rgb(45, 191, 184)"}, +) + // Check the color of "associated type". assert-css: ( - ".result-name .associatedtype", + ".result-associatedtype .associatedtype", {"color": "rgb(210, 153, 29)"}, ALL, ) +assert-css: ( + ".result-associatedtype", + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-associatedtype" +assert-css: ( + ".result-associatedtype:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-associatedtype:hover .associatedtype", + {"color": "rgb(210, 153, 29)"}, +) +move-cursor-to: ".search-input" +focus: ".result-associatedtype" +assert-css: ( + ".result-associatedtype:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-associatedtype:focus .associatedtype", + {"color": "rgb(210, 153, 29)"}, +) + // Check the color of "type method". assert-css: ( - ".result-name .tymethod", + ".result-tymethod .tymethod", {"color": "rgb(43, 171, 99)"}, ALL, ) +assert-css: ( + ".result-tymethod", + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-tymethod" +assert-css: ( + ".result-tymethod:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-tymethod:hover .tymethod", + {"color": "rgb(43, 171, 99)"}, +) +move-cursor-to: ".search-input" +focus: ".result-tymethod" +assert-css: ( + ".result-tymethod:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-tymethod:focus .tymethod", + {"color": "rgb(43, 171, 99)"}, +) + // Check the color of "method". assert-css: ( - ".result-name .method", + ".result-method .method", {"color": "rgb(43, 171, 99)"}, ALL, ) +assert-css: ( + ".result-method", + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-method" +assert-css: ( + ".result-method:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-method:hover .method", + {"color": "rgb(43, 171, 99)"}, +) +move-cursor-to: ".search-input" +focus: ".result-method" +assert-css: ( + ".result-method:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-method:focus .method", + {"color": "rgb(43, 171, 99)"}, +) + // Check the color of "struct field". assert-css: ( - ".result-name .structfield", + ".result-structfield .structfield", {"color": "rgb(221, 221, 221)"}, ALL, ) +assert-css: ( + ".result-structfield", + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-structfield" +assert-css: ( + ".result-structfield:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-structfield:hover .structfield", + {"color": "rgb(221, 221, 221)"}, +) +move-cursor-to: ".search-input" +focus: ".result-structfield" +assert-css: ( + ".result-structfield:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-structfield:focus .structfield", + {"color": "rgb(221, 221, 221)"}, +) + // Check the color of "macro". assert-css: ( - ".result-name .macro", + ".result-macro .macro", {"color": "rgb(9, 189, 0)"}, ALL, ) +assert-css: ( + ".result-macro", + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-macro" +assert-css: ( + ".result-macro:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-macro:hover .macro", + {"color": "rgb(9, 189, 0)"}, +) +move-cursor-to: ".search-input" +focus: ".result-macro" +assert-css: ( + ".result-macro:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-macro:focus .macro", + {"color": "rgb(9, 189, 0)"}, +) + // Check the color of "fn". assert-css: ( - ".result-name .fn", + ".result-fn .fn", {"color": "rgb(43, 171, 99)"}, ALL, ) - -// Checking the `<a>` container. assert-css: ( - "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", + ".result-fn", {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, ) - -// Checking color and background on hover. -move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']" +move-cursor-to: ".result-fn" assert-css: ( - "//*[@class='result-name']/*[text()='test_docs::']", - {"color": "rgb(221, 221, 221)"}, + ".result-fn:hover", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, ) assert-css: ( + ".result-fn:hover .fn", + {"color": "rgb(43, 171, 99)"}, +) +move-cursor-to: ".search-input" +focus: ".result-fn" +assert-css: ( + ".result-fn:focus", + {"color": "rgb(221, 221, 221)", "background-color": "rgb(97, 97, 97)"}, +) +assert-css: ( + ".result-fn:focus .fn", + {"color": "rgb(43, 171, 99)"}, +) + +// Checking the `<a>` container. +move-cursor-to: ".search-input" +focus: ".search-input" // To ensure the `<a>` container isnt focus or hover. +assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", - {"color": "rgb(221, 221, 221)", "background-color": "rgb(119, 119, 119)"}, + {"color": "rgb(221, 221, 221)", "background-color": "rgba(0, 0, 0, 0)"}, ) // Light theme @@ -200,7 +571,7 @@ assert-css: ( {"color": "rgb(0, 0, 0)"}, ) -// Checking the color for "keyword". +// Checking the color for "keyword" text. assert-css: ( "//*[@class='result-name']//*[text()='(keyword)']", {"color": "rgb(0, 0, 0)"}, @@ -208,68 +579,250 @@ assert-css: ( // Checking the color of "keyword". assert-css: ( - ".result-name .keyword", + ".result-keyword .keyword", {"color": "rgb(56, 115, 173)"}, ALL, ) +assert-css: ( + ".result-keyword", + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-keyword" +assert-css: ( + ".result-keyword:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-keyword:hover .keyword", + {"color": "rgb(56, 115, 173)"}, +) +move-cursor-to: ".search-input" +focus: ".result-keyword" +assert-css: ( + ".result-keyword:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-keyword:focus .keyword", + {"color": "rgb(56, 115, 173)"}, +) + // Check the color of "struct". assert-css: ( - ".result-name .struct", + ".result-struct .struct", {"color": "rgb(173, 55, 138)"}, ALL, ) +assert-css: ( + ".result-struct", + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-struct" +assert-css: ( + ".result-struct:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-struct:hover .struct", + {"color": "rgb(173, 55, 138)"}, +) +move-cursor-to: ".search-input" +focus: ".result-struct" +assert-css: ( + ".result-struct:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-struct:focus .struct", + {"color": "rgb(173, 55, 138)"}, +) + // Check the color of "associated type". assert-css: ( - ".result-name .associatedtype", + ".result-associatedtype .associatedtype", {"color": "rgb(56, 115, 173)"}, ALL, ) +assert-css: ( + ".result-associatedtype", + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-associatedtype" +assert-css: ( + ".result-associatedtype:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-associatedtype:hover .associatedtype", + {"color": "rgb(56, 115, 173)"}, +) +move-cursor-to: ".search-input" +focus: ".result-associatedtype" +assert-css: ( + ".result-associatedtype:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-associatedtype:focus .associatedtype", + {"color": "rgb(56, 115, 173)"}, +) + // Check the color of "type method". assert-css: ( - ".result-name .tymethod", + ".result-tymethod .tymethod", {"color": "rgb(173, 124, 55)"}, ALL, ) +assert-css: ( + ".result-tymethod", + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-tymethod" +assert-css: ( + ".result-tymethod:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-tymethod:hover .tymethod", + {"color": "rgb(173, 124, 55)"}, +) +move-cursor-to: ".search-input" +focus: ".result-tymethod" +assert-css: ( + ".result-tymethod:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-tymethod:focus .tymethod", + {"color": "rgb(173, 124, 55)"}, +) + // Check the color of "method". assert-css: ( - ".result-name .method", + ".result-method .method", {"color": "rgb(173, 124, 55)"}, ALL, ) +assert-css: ( + ".result-method", + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-method" +assert-css: ( + ".result-method:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-method:hover .method", + {"color": "rgb(173, 124, 55)"}, +) +move-cursor-to: ".search-input" +focus: ".result-method" +assert-css: ( + ".result-method:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-method:focus .method", + {"color": "rgb(173, 124, 55)"}, +) + // Check the color of "struct field". assert-css: ( - ".result-name .structfield", + ".result-structfield .structfield", {"color": "rgb(0, 0, 0)"}, ALL, ) +assert-css: ( + ".result-structfield", + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-structfield" +assert-css: ( + ".result-structfield:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-structfield:hover .structfield", + {"color": "rgb(0, 0, 0)"}, +) +move-cursor-to: ".search-input" +focus: ".result-structfield" +assert-css: ( + ".result-structfield:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-structfield:focus .structfield", + {"color": "rgb(0, 0, 0)"}, +) + // Check the color of "macro". assert-css: ( - ".result-name .macro", + ".result-macro .macro", {"color": "rgb(6, 128, 0)"}, ALL, ) +assert-css: ( + ".result-macro", + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, +) +move-cursor-to: ".result-macro" +assert-css: ( + ".result-macro:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-macro:hover .macro", + {"color": "rgb(6, 128, 0)"}, +) +move-cursor-to: ".search-input" +focus: ".result-macro" +assert-css: ( + ".result-macro:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-macro:focus .macro", + {"color": "rgb(6, 128, 0)"}, +) + // Check the color of "fn". assert-css: ( - ".result-name .fn", + ".result-fn .fn", {"color": "rgb(173, 124, 55)"}, ALL, ) - -// Checking the `<a>` container. assert-css: ( - "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", + ".result-fn", {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, ) - -// Checking color and background on hover. -move-cursor-to: "//*[@class='desc']//*[text()='Just a normal struct.']" +move-cursor-to: ".result-fn" assert-css: ( - "//*[@class='result-name']/*[text()='test_docs::']", - {"color": "rgb(0, 0, 0)"}, + ".result-fn:hover", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, ) assert-css: ( + ".result-fn:hover .fn", + {"color": "rgb(173, 124, 55)"}, +) +move-cursor-to: ".search-input" +focus: ".result-fn" +assert-css: ( + ".result-fn:focus", + {"color": "rgb(0, 0, 0)", "background-color": "rgb(204, 204, 204)"}, +) +assert-css: ( + ".result-fn:focus .fn", + {"color": "rgb(173, 124, 55)"}, +) + +// Checking the `<a>` container. +move-cursor-to: ".search-input" +focus: ".search-input" // To ensure the `<a>` container isnt focus or hover. +assert-css: ( "//*[@class='result-name']/*[text()='test_docs::']/ancestor::a", - {"color": "rgb(0, 0, 0)", "background-color": "rgb(221, 221, 221)"}, + {"color": "rgb(0, 0, 0)", "background-color": "rgba(0, 0, 0, 0)"}, ) // Check the alias more specifically in the dark theme. diff --git a/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.out0.html b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.out0.html new file mode 100644 index 00000000000..927a1a42a1f --- /dev/null +++ b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.out0.html @@ -0,0 +1 @@ +<h4 class="code-header">type <a href="#associatedtype.Out0" class="associatedtype">Out0</a>: <a class="trait" href="../assoc_item_trait_bounds_with_bindings/trait.Support.html" title="trait assoc_item_trait_bounds_with_bindings::Support">Support</a><Item = <a class="primitive" href="{{channel}}/std/primitive.unit.html">()</a>></h4> \ No newline at end of file diff --git a/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.out9.html b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.out9.html new file mode 100644 index 00000000000..69d84e1b2c1 --- /dev/null +++ b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.out9.html @@ -0,0 +1 @@ +<h4 class="code-header">type <a href="#associatedtype.Out9" class="associatedtype">Out9</a>: <a class="trait" href="{{channel}}/core/ops/function/trait.FnMut.html" title="trait core::ops::function::FnMut">FnMut</a>(<a class="primitive" href="{{channel}}/std/primitive.i32.html">i32</a>) -> <a class="primitive" href="{{channel}}/std/primitive.bool.html">bool</a> + <a class="trait" href="{{channel}}/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a></h4> \ No newline at end of file diff --git a/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.rs b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.rs new file mode 100644 index 00000000000..b026f399a56 --- /dev/null +++ b/src/test/rustdoc/inline_cross/assoc_item_trait_bounds_with_bindings.rs @@ -0,0 +1,40 @@ +// Regression test for issues #77763, #84579 and #102142. +#![crate_name = "main"] + +// aux-build:assoc_item_trait_bounds_with_bindings.rs +// build-aux-docs +// ignore-cross-compile +extern crate assoc_item_trait_bounds_with_bindings as aux; + +// FIXME(fmease): Don't render an incorrect `T: ?Sized` where-clause for parameters +// of GATs like `Main::Out{2,4}`. Add a snapshot test once it's fixed. +// FIXME(fmease): Print the `for<>` parameter list in the bounds of +// `Main::Out{6,11,12}`. + +// @has main/trait.Main.html +// @has - '//*[@id="associatedtype.Out0"]' 'type Out0: Support<Item = ()>' +// @has - '//*[@id="associatedtype.Out1"]' 'type Out1: Support<Item = Self::Item>' +// @has - '//*[@id="associatedtype.Out2"]' 'type Out2<T>: Support<Item = T>' +// @has - '//*[@id="associatedtype.Out3"]' 'type Out3: Support<Produce<()> = bool>' +// @has - '//*[@id="associatedtype.Out4"]' 'type Out4<T>: Support<Produce<T> = T>' +// @has - '//*[@id="associatedtype.Out5"]' "type Out5: Support<Output<'static> = &'static ()>" +// @has - '//*[@id="associatedtype.Out6"]' "type Out6: Support<Output<'a> = &'a ()>" +// @has - '//*[@id="associatedtype.Out7"]' "type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated" +// @has - '//*[@id="associatedtype.Out8"]' "type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>" +// @has - '//*[@id="associatedtype.Out9"]' "type Out9: FnMut(i32) -> bool + Clone" +// @has - '//*[@id="associatedtype.Out10"]' "type Out10<'q>: Support<Output<'q> = ()>" +// @has - '//*[@id="associatedtype.Out11"]' "type Out11: Helper<A<'s> = &'s (), B<'r> = ()>" +// @has - '//*[@id="associatedtype.Out12"]' "type Out12: Helper<B<'w> = Cow<'w, str>, A<'w> = bool>" +// +// Snapshots: Check that we do not render any where-clauses for those associated types since all of +// the trait bounds contained within were moved to the bounds of the respective item. +// +// @snapshot out0 - '//*[@id="associatedtype.Out0"]/*[@class="code-header"]' +// @snapshot out9 - '//*[@id="associatedtype.Out9"]/*[@class="code-header"]' +// +// @has - '//*[@id="tymethod.make"]' \ +// "fn make<F>(F, impl FnMut(&str) -> bool)\ +// where \ +// F: FnOnce(u32) -> String, \ +// Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>" +pub use aux::Main; diff --git a/src/test/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds_with_bindings.rs b/src/test/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds_with_bindings.rs new file mode 100644 index 00000000000..7225f2dca10 --- /dev/null +++ b/src/test/rustdoc/inline_cross/auxiliary/assoc_item_trait_bounds_with_bindings.rs @@ -0,0 +1,40 @@ +pub trait Main { + type Item; + + type Out0: Support<Item = ()>; + type Out1: Support<Item = Self::Item>; + type Out2<T>: Support<Item = T>; + type Out3: Support<Produce<()> = bool>; + type Out4<T>: Support<Produce<T> = T>; + type Out5: Support<Output<'static> = &'static ()>; + type Out6: for<'a> Support<Output<'a> = &'a ()>; + type Out7: Support<Item = String, Produce<i32> = u32> + Unrelated; + type Out8: Unrelated + Protocol<i16, Q1 = u128, Q0 = ()>; + type Out9: FnMut(i32) -> bool + Clone; + type Out10<'q>: Support<Output<'q> = ()>; + type Out11: for<'r, 's> Helper<A<'s> = &'s (), B<'r> = ()>; + type Out12: for<'w> Helper<B<'w> = std::borrow::Cow<'w, str>, A<'w> = bool>; + + fn make<F>(_: F, _: impl FnMut(&str) -> bool) + where + F: FnOnce(u32) -> String, + Self::Out2<()>: Protocol<u8, Q0 = Self::Item, Q1 = ()>; +} + +pub trait Support { + type Item; + type Output<'a>; + type Produce<T>; +} + +pub trait Protocol<K> { + type Q0; + type Q1; +} + +pub trait Unrelated {} + +pub trait Helper { + type A<'q>; + type B<'q>; +} diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.rs b/src/test/ui-fulldeps/internal-lints/diagnostics.rs index 18e39108eca..9a5100ce17f 100644 --- a/src/test/ui-fulldeps/internal-lints/diagnostics.rs +++ b/src/test/ui-fulldeps/internal-lints/diagnostics.rs @@ -19,14 +19,14 @@ use rustc_macros::{Diagnostic, Subdiagnostic}; use rustc_span::Span; #[derive(Diagnostic)] -#[diag(parser::expect_path)] +#[diag(compiletest::example)] struct DeriveDiagnostic { #[primary_span] span: Span, } #[derive(Subdiagnostic)] -#[note(parser::add_paren)] +#[note(compiletest::example)] struct Note { #[primary_span] span: Span, @@ -45,7 +45,7 @@ pub struct TranslatableInIntoDiagnostic; impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInIntoDiagnostic { fn into_diagnostic(self, handler: &'a Handler) -> DiagnosticBuilder<'a, ErrorGuaranteed> { - handler.struct_err(fluent::parser::expect_path) + handler.struct_err(fluent::compiletest::example) } } @@ -62,12 +62,12 @@ pub struct TranslatableInAddToDiagnostic; impl AddToDiagnostic for TranslatableInAddToDiagnostic { fn add_to_diagnostic(self, diag: &mut Diagnostic) { - diag.note(fluent::typeck::note); + diag.note(fluent::compiletest::note); } } pub fn make_diagnostics<'a>(handler: &'a Handler) { - let _diag = handler.struct_err(fluent::parser::expect_path); + let _diag = handler.struct_err(fluent::compiletest::example); //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls let _diag = handler.struct_err("untranslatable diagnostic"); diff --git a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr index 9219d09e9b4..f5f92ac1e7f 100644 --- a/src/test/ui-fulldeps/internal-lints/diagnostics.stderr +++ b/src/test/ui-fulldeps/internal-lints/diagnostics.stderr @@ -19,7 +19,7 @@ LL | diag.note("untranslatable diagnostic"); error: diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic` impls --> $DIR/diagnostics.rs:70:25 | -LL | let _diag = handler.struct_err(fluent::parser::expect_path); +LL | let _diag = handler.struct_err(fluent::compiletest::example); | ^^^^^^^^^^ | note: the lint level is defined here diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs index d425f6f34e9..1dc71abc104 100644 --- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs +++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.rs @@ -28,15 +28,15 @@ use rustc_errors::{Applicability, MultiSpan}; extern crate rustc_session; #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct Hello {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct HelloWarn {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] //~^ ERROR unsupported type attribute for diagnostic derive enum enum DiagnosticOnEnum { Foo, @@ -46,13 +46,13 @@ enum DiagnosticOnEnum { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] #[diag = "E0123"] //~^ ERROR `#[diag = ...]` is not a valid attribute struct WrongStructAttrStyle {} #[derive(Diagnostic)] -#[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[nonsense(compiletest::example, code = "E0123")] //~^ ERROR `#[nonsense(...)]` is not a valid attribute //~^^ ERROR diagnostic slug not specified //~^^^ ERROR cannot find attribute `nonsense` in this scope @@ -90,12 +90,12 @@ struct InvalidNestedStructAttr2 {} struct InvalidNestedStructAttr3 {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")] +#[diag(compiletest::example, code = "E0123", slug = "foo")] //~^ ERROR `#[diag(slug = ...)]` is not a valid attribute struct InvalidNestedStructAttr4 {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct WrongPlaceField { #[suggestion = "bar"] //~^ ERROR `#[suggestion = ...]` is not a valid attribute @@ -103,20 +103,20 @@ struct WrongPlaceField { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] +#[diag(compiletest::example, code = "E0123")] +#[diag(compiletest::example, code = "E0456")] //~^ ERROR specified multiple times //~^^ ERROR specified multiple times struct DiagSpecifiedTwice {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")] +#[diag(compiletest::example, code = "E0456", code = "E0457")] //~^ ERROR specified multiple times struct CodeSpecifiedTwice {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")] -//~^ ERROR `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute +#[diag(compiletest::example, compiletest::example, code = "E0456")] +//~^ ERROR `#[diag(compiletest::example)]` is not a valid attribute struct SlugSpecifiedTwice {} #[derive(Diagnostic)] @@ -128,11 +128,11 @@ struct KindNotProvided {} //~ ERROR diagnostic slug not specified struct SlugNotProvided {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound)] +#[diag(compiletest::example)] struct CodeNotProvided {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct MessageWrongType { #[primary_span] //~^ ERROR `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan` @@ -140,7 +140,7 @@ struct MessageWrongType { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct InvalidPathFieldAttr { #[nonsense] //~^ ERROR `#[nonsense]` is not a valid attribute @@ -149,34 +149,34 @@ struct InvalidPathFieldAttr { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithField { name: String, - #[label(typeck::label)] + #[label(compiletest::label)] span: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithMessageAppliedToField { - #[label(typeck::label)] + #[label(compiletest::label)] //~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` name: String, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithNonexistentField { - #[suggestion(typeck::suggestion, code = "{name}")] + #[suggestion(compiletest::suggestion, code = "{name}")] //~^ ERROR `name` doesn't refer to a field on this type suggestion: (Span, Applicability), } #[derive(Diagnostic)] //~^ ERROR invalid format string: expected `'}'` -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorMissingClosingBrace { - #[suggestion(typeck::suggestion, code = "{name")] + #[suggestion(compiletest::suggestion, code = "{name")] suggestion: (Span, Applicability), name: String, val: usize, @@ -184,49 +184,49 @@ struct ErrorMissingClosingBrace { #[derive(Diagnostic)] //~^ ERROR invalid format string: unmatched `}` -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorMissingOpeningBrace { - #[suggestion(typeck::suggestion, code = "name}")] + #[suggestion(compiletest::suggestion, code = "name}")] suggestion: (Span, Applicability), name: String, val: usize, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct LabelOnSpan { - #[label(typeck::label)] + #[label(compiletest::label)] sp: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct LabelOnNonSpan { - #[label(typeck::label)] + #[label(compiletest::label)] //~^ ERROR the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` id: u32, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct Suggest { - #[suggestion(typeck::suggestion, code = "This is the suggested code")] - #[suggestion_short(typeck::suggestion, code = "This is the suggested code")] - #[suggestion_hidden(typeck::suggestion, code = "This is the suggested code")] - #[suggestion_verbose(typeck::suggestion, code = "This is the suggested code")] + #[suggestion(compiletest::suggestion, code = "This is the suggested code")] + #[suggestion_short(compiletest::suggestion, code = "This is the suggested code")] + #[suggestion_hidden(compiletest::suggestion, code = "This is the suggested code")] + #[suggestion_verbose(compiletest::suggestion, code = "This is the suggested code")] suggestion: (Span, Applicability), } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithoutCode { - #[suggestion(typeck::suggestion)] + #[suggestion(compiletest::suggestion)] //~^ ERROR suggestion without `code = "..."` suggestion: (Span, Applicability), } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithBadKey { #[suggestion(nonsense = "bar")] //~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute @@ -235,7 +235,7 @@ struct SuggestWithBadKey { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithShorthandMsg { #[suggestion(msg = "bar")] //~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute @@ -244,52 +244,52 @@ struct SuggestWithShorthandMsg { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithoutMsg { #[suggestion(code = "bar")] suggestion: (Span, Applicability), } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithTypesSwapped { - #[suggestion(typeck::suggestion, code = "This is suggested code")] + #[suggestion(compiletest::suggestion, code = "This is suggested code")] suggestion: (Applicability, Span), } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithWrongTypeApplicabilityOnly { - #[suggestion(typeck::suggestion, code = "This is suggested code")] + #[suggestion(compiletest::suggestion, code = "This is suggested code")] //~^ ERROR wrong field type for suggestion suggestion: Applicability, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithSpanOnly { - #[suggestion(typeck::suggestion, code = "This is suggested code")] + #[suggestion(compiletest::suggestion, code = "This is suggested code")] suggestion: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithDuplicateSpanAndApplicability { - #[suggestion(typeck::suggestion, code = "This is suggested code")] + #[suggestion(compiletest::suggestion, code = "This is suggested code")] suggestion: (Span, Span, Applicability), //~^ ERROR specified multiple times } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct SuggestWithDuplicateApplicabilityAndSpan { - #[suggestion(typeck::suggestion, code = "This is suggested code")] + #[suggestion(compiletest::suggestion, code = "This is suggested code")] suggestion: (Applicability, Applicability, Span), //~^ ERROR specified multiple times } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct WrongKindOfAnnotation { #[label = "bar"] //~^ ERROR `#[label = ...]` is not a valid attribute @@ -297,38 +297,38 @@ struct WrongKindOfAnnotation { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct OptionsInErrors { - #[label(typeck::label)] + #[label(compiletest::label)] label: Option<Span>, - #[suggestion(typeck::suggestion, code = "...")] + #[suggestion(compiletest::suggestion, code = "...")] opt_sugg: Option<(Span, Applicability)>, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] +#[diag(compiletest::example, code = "E0456")] struct MoveOutOfBorrowError<'tcx> { name: Ident, ty: Ty<'tcx>, #[primary_span] - #[label(typeck::label)] + #[label(compiletest::label)] span: Span, - #[label(typeck::label)] + #[label(compiletest::label)] other_span: Span, - #[suggestion(typeck::suggestion, code = "{name}.clone()")] + #[suggestion(compiletest::suggestion, code = "{name}.clone()")] opt_sugg: Option<(Span, Applicability)>, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithLifetime<'a> { - #[label(typeck::label)] + #[label(compiletest::label)] span: Span, name: &'a str, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithDefaultLabelAttr<'a> { #[label] span: Span, @@ -337,7 +337,7 @@ struct ErrorWithDefaultLabelAttr<'a> { #[derive(Diagnostic)] //~^ ERROR the trait bound `Hello: IntoDiagnosticArg` is not satisfied -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ArgFieldWithoutSkip { #[primary_span] span: Span, @@ -345,7 +345,7 @@ struct ArgFieldWithoutSkip { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ArgFieldWithSkip { #[primary_span] span: Span, @@ -356,116 +356,116 @@ struct ArgFieldWithSkip { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithSpannedNote { #[note] span: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithSpannedNoteCustom { - #[note(typeck::note)] + #[note(compiletest::note)] span: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] #[note] struct ErrorWithNote { val: String, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] -#[note(typeck::note)] +#[diag(compiletest::example, code = "E0123")] +#[note(compiletest::note)] struct ErrorWithNoteCustom { val: String, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithSpannedHelp { #[help] span: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithSpannedHelpCustom { - #[help(typeck::help)] + #[help(compiletest::help)] span: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] #[help] struct ErrorWithHelp { val: String, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] -#[help(typeck::help)] +#[diag(compiletest::example, code = "E0123")] +#[help(compiletest::help)] struct ErrorWithHelpCustom { val: String, } #[derive(Diagnostic)] #[help] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithHelpWrongOrder { val: String, } #[derive(Diagnostic)] -#[help(typeck::help)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[help(compiletest::help)] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithHelpCustomWrongOrder { val: String, } #[derive(Diagnostic)] #[note] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithNoteWrongOrder { val: String, } #[derive(Diagnostic)] -#[note(typeck::note)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[note(compiletest::note)] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithNoteCustomWrongOrder { val: String, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ApplicabilityInBoth { - #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] + #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")] //~^ ERROR specified multiple times suggestion: (Span, Applicability), } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct InvalidApplicability { - #[suggestion(typeck::suggestion, code = "...", applicability = "batman")] + #[suggestion(compiletest::suggestion, code = "...", applicability = "batman")] //~^ ERROR invalid applicability suggestion: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ValidApplicability { - #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] + #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")] suggestion: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct NoApplicability { - #[suggestion(typeck::suggestion, code = "...")] + #[suggestion(compiletest::suggestion, code = "...")] suggestion: Span, } @@ -474,14 +474,14 @@ struct NoApplicability { struct Note; #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound)] +#[diag(compiletest::example)] struct Subdiagnostic { #[subdiagnostic] note: Note, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct VecField { #[primary_span] #[label] @@ -489,58 +489,58 @@ struct VecField { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct UnitField { #[primary_span] spans: Span, #[help] foo: (), - #[help(typeck::help)] + #[help(compiletest::help)] bar: (), } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct OptUnitField { #[primary_span] spans: Span, #[help] foo: Option<()>, - #[help(typeck::help)] + #[help(compiletest::help)] bar: Option<()>, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct LabelWithTrailingPath { - #[label(typeck::label, foo)] + #[label(compiletest::label, foo)] //~^ ERROR `#[label(foo)]` is not a valid attribute span: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct LabelWithTrailingNameValue { - #[label(typeck::label, foo = "...")] + #[label(compiletest::label, foo = "...")] //~^ ERROR `#[label(foo = ...)]` is not a valid attribute span: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct LabelWithTrailingList { - #[label(typeck::label, foo("..."))] + #[label(compiletest::label, foo("..."))] //~^ ERROR `#[label(foo(...))]` is not a valid attribute span: Span, } #[derive(LintDiagnostic)] -#[diag(typeck::ambiguous_lifetime_bound)] +#[diag(compiletest::example)] struct LintsGood { } #[derive(LintDiagnostic)] -#[diag(typeck::ambiguous_lifetime_bound)] +#[diag(compiletest::example)] struct PrimarySpanOnLint { #[primary_span] //~^ ERROR `#[primary_span]` is not a valid attribute @@ -548,42 +548,42 @@ struct PrimarySpanOnLint { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct ErrorWithMultiSpan { #[primary_span] span: MultiSpan, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] #[warning] struct ErrorWithWarn { val: String, } #[derive(Diagnostic)] -#[error(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[error(compiletest::example, code = "E0123")] //~^ ERROR `#[error(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified //~| ERROR cannot find attribute `error` in this scope struct ErrorAttribute {} #[derive(Diagnostic)] -#[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[warn_(compiletest::example, code = "E0123")] //~^ ERROR `#[warn_(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified //~| ERROR cannot find attribute `warn_` in this scope struct WarnAttribute {} #[derive(Diagnostic)] -#[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[lint(compiletest::example, code = "E0123")] //~^ ERROR `#[lint(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified //~| ERROR cannot find attribute `lint` in this scope struct LintAttributeOnSessionDiag {} #[derive(LintDiagnostic)] -#[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[lint(compiletest::example, code = "E0123")] //~^ ERROR `#[lint(...)]` is not a valid attribute //~| ERROR `#[lint(...)]` is not a valid attribute //~| ERROR diagnostic slug not specified @@ -591,55 +591,55 @@ struct LintAttributeOnSessionDiag {} struct LintAttributeOnLintDiag {} #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct DuplicatedSuggestionCode { - #[suggestion(typeck::suggestion, code = "...", code = ",,,")] + #[suggestion(compiletest::suggestion, code = "...", code = ",,,")] //~^ ERROR specified multiple times suggestion: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct InvalidTypeInSuggestionTuple { - #[suggestion(typeck::suggestion, code = "...")] + #[suggestion(compiletest::suggestion, code = "...")] suggestion: (Span, usize), //~^ ERROR wrong types for suggestion } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct MissingApplicabilityInSuggestionTuple { - #[suggestion(typeck::suggestion, code = "...")] + #[suggestion(compiletest::suggestion, code = "...")] suggestion: (Span,), //~^ ERROR wrong types for suggestion } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct MissingCodeInSuggestion { - #[suggestion(typeck::suggestion)] + #[suggestion(compiletest::suggestion)] //~^ ERROR suggestion without `code = "..."` suggestion: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] -#[multipart_suggestion(typeck::suggestion)] +#[diag(compiletest::example, code = "E0123")] +#[multipart_suggestion(compiletest::suggestion)] //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute //~| ERROR cannot find attribute `multipart_suggestion` in this scope #[multipart_suggestion()] //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute //~| ERROR cannot find attribute `multipart_suggestion` in this scope struct MultipartSuggestion { - #[multipart_suggestion(typeck::suggestion)] + #[multipart_suggestion(compiletest::suggestion)] //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute //~| ERROR cannot find attribute `multipart_suggestion` in this scope suggestion: Span, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] -#[suggestion(typeck::suggestion, code = "...")] +#[diag(compiletest::example, code = "E0123")] +#[suggestion(compiletest::suggestion, code = "...")] //~^ ERROR `#[suggestion(...)]` is not a valid attribute struct SuggestionOnStruct { #[primary_span] @@ -647,7 +647,7 @@ struct SuggestionOnStruct { } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] #[label] //~^ ERROR `#[label]` is not a valid attribute struct LabelOnStruct { @@ -657,24 +657,24 @@ struct LabelOnStruct { #[derive(Diagnostic)] enum ExampleEnum { - #[diag(typeck::ambiguous_lifetime_bound)] + #[diag(compiletest::example)] Foo { #[primary_span] sp: Span, #[note] note_sp: Span, }, - #[diag(typeck::ambiguous_lifetime_bound)] + #[diag(compiletest::example)] Bar { #[primary_span] sp: Span, }, - #[diag(typeck::ambiguous_lifetime_bound)] + #[diag(compiletest::example)] Baz, } #[derive(Diagnostic)] -#[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] +#[diag(compiletest::example, code = "E0123")] struct RawIdentDiagnosticArg { pub r#type: String, } diff --git a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr index 17bab3a1d65..167198b47f2 100644 --- a/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr +++ b/src/test/ui-fulldeps/session-diagnostic/diagnostic-derive.stderr @@ -1,8 +1,8 @@ error: unsupported type attribute for diagnostic derive enum --> $DIR/diagnostic-derive.rs:39:1 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[diag(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:42:5 @@ -10,7 +10,7 @@ error: diagnostic slug not specified LL | Foo, | ^^^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:44:5 @@ -18,7 +18,7 @@ error: diagnostic slug not specified LL | Bar, | ^^^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[diag = ...]` is not a valid attribute --> $DIR/diagnostic-derive.rs:50:1 @@ -29,20 +29,20 @@ LL | #[diag = "E0123"] error: `#[nonsense(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:55:1 | -LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[nonsense(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:55:1 | -LL | / #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | / #[nonsense(compiletest::example, code = "E0123")] LL | | LL | | LL | | LL | | struct InvalidStructAttr {} | |___________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[diag("...")]` is not a valid attribute --> $DIR/diagnostic-derive.rs:62:8 @@ -61,7 +61,7 @@ LL | | LL | | struct InvalidLitNestedAttr {} | |______________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[diag(nonsense(...))]` is not a valid attribute --> $DIR/diagnostic-derive.rs:73:8 @@ -80,7 +80,7 @@ LL | | LL | | struct InvalidNestedStructAttr1 {} | |__________________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[diag(nonsense = ...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:79:8 @@ -108,7 +108,7 @@ LL | | LL | | struct InvalidNestedStructAttr2 {} | |__________________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[diag(nonsense = ...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:86:8 @@ -134,13 +134,13 @@ LL | | LL | | struct InvalidNestedStructAttr3 {} | |__________________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[diag(slug = ...)]` is not a valid attribute - --> $DIR/diagnostic-derive.rs:93:58 + --> $DIR/diagnostic-derive.rs:93:46 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123", slug = "foo")] - | ^^^^^^^^^^^^ +LL | #[diag(compiletest::example, code = "E0123", slug = "foo")] + | ^^^^^^^^^^^^ | = help: only `code` is a valid nested attributes following the slug @@ -153,44 +153,44 @@ LL | #[suggestion = "bar"] error: specified multiple times --> $DIR/diagnostic-derive.rs:107:8 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[diag(compiletest::example, code = "E0456")] + | ^^^^^^^^^^^^^^^^^^^^ | note: previously specified here --> $DIR/diagnostic-derive.rs:106:8 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[diag(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^ error: specified multiple times - --> $DIR/diagnostic-derive.rs:107:49 + --> $DIR/diagnostic-derive.rs:107:37 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456")] - | ^^^^^^^ +LL | #[diag(compiletest::example, code = "E0456")] + | ^^^^^^^ | note: previously specified here - --> $DIR/diagnostic-derive.rs:106:49 + --> $DIR/diagnostic-derive.rs:106:37 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^ +LL | #[diag(compiletest::example, code = "E0123")] + | ^^^^^^^ error: specified multiple times - --> $DIR/diagnostic-derive.rs:113:65 + --> $DIR/diagnostic-derive.rs:113:53 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")] - | ^^^^^^^ +LL | #[diag(compiletest::example, code = "E0456", code = "E0457")] + | ^^^^^^^ | note: previously specified here - --> $DIR/diagnostic-derive.rs:113:49 + --> $DIR/diagnostic-derive.rs:113:37 | -LL | #[diag(typeck::ambiguous_lifetime_bound, code = "E0456", code = "E0457")] - | ^^^^^^^ +LL | #[diag(compiletest::example, code = "E0456", code = "E0457")] + | ^^^^^^^ -error: `#[diag(typeck::ambiguous_lifetime_bound)]` is not a valid attribute - --> $DIR/diagnostic-derive.rs:118:42 +error: `#[diag(compiletest::example)]` is not a valid attribute + --> $DIR/diagnostic-derive.rs:118:30 | -LL | #[diag(typeck::ambiguous_lifetime_bound, typeck::ambiguous_lifetime_bound, code = "E0456")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[diag(compiletest::example, compiletest::example, code = "E0456")] + | ^^^^^^^^^^^^^^^^^^^^ | = help: diagnostic slug must be the first argument @@ -200,7 +200,7 @@ error: diagnostic slug not specified LL | struct KindNotProvided {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:126:1 @@ -210,7 +210,7 @@ LL | | LL | | struct SlugNotProvided {} | |_________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan` --> $DIR/diagnostic-derive.rs:137:5 @@ -227,14 +227,14 @@ LL | #[nonsense] error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` --> $DIR/diagnostic-derive.rs:162:5 | -LL | #[label(typeck::label)] - | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[label(compiletest::label)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `name` doesn't refer to a field on this type - --> $DIR/diagnostic-derive.rs:170:45 + --> $DIR/diagnostic-derive.rs:170:50 | -LL | #[suggestion(typeck::suggestion, code = "{name}")] - | ^^^^^^^^ +LL | #[suggestion(compiletest::suggestion, code = "{name}")] + | ^^^^^^^^ error: invalid format string: expected `'}'` but string was terminated --> $DIR/diagnostic-derive.rs:175:10 @@ -257,14 +257,14 @@ LL | #[derive(Diagnostic)] error: the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan` --> $DIR/diagnostic-derive.rs:205:5 | -LL | #[label(typeck::label)] - | ^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[label(compiletest::label)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: suggestion without `code = "..."` --> $DIR/diagnostic-derive.rs:223:5 | -LL | #[suggestion(typeck::suggestion)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[suggestion(compiletest::suggestion)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[suggestion(nonsense = ...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:231:18 @@ -297,7 +297,7 @@ LL | #[suggestion(msg = "bar")] error: wrong field type for suggestion --> $DIR/diagnostic-derive.rs:263:5 | -LL | / #[suggestion(typeck::suggestion, code = "This is suggested code")] +LL | / #[suggestion(compiletest::suggestion, code = "This is suggested code")] LL | | LL | | suggestion: Applicability, | |_____________________________^ @@ -335,10 +335,10 @@ LL | #[label = "bar"] | ^^^^^^^^^^^^^^^^ error: specified multiple times - --> $DIR/diagnostic-derive.rs:445:52 + --> $DIR/diagnostic-derive.rs:445:57 | -LL | #[suggestion(typeck::suggestion, code = "...", applicability = "maybe-incorrect")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[suggestion(compiletest::suggestion, code = "...", applicability = "maybe-incorrect")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: previously specified here --> $DIR/diagnostic-derive.rs:447:24 @@ -347,30 +347,30 @@ LL | suggestion: (Span, Applicability), | ^^^^^^^^^^^^^ error: invalid applicability - --> $DIR/diagnostic-derive.rs:453:52 + --> $DIR/diagnostic-derive.rs:453:57 | -LL | #[suggestion(typeck::suggestion, code = "...", applicability = "batman")] - | ^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[suggestion(compiletest::suggestion, code = "...", applicability = "batman")] + | ^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[label(foo)]` is not a valid attribute - --> $DIR/diagnostic-derive.rs:516:28 + --> $DIR/diagnostic-derive.rs:516:33 | -LL | #[label(typeck::label, foo)] - | ^^^ +LL | #[label(compiletest::label, foo)] + | ^^^ | = help: a diagnostic slug must be the first argument to the attribute error: `#[label(foo = ...)]` is not a valid attribute - --> $DIR/diagnostic-derive.rs:524:28 + --> $DIR/diagnostic-derive.rs:524:33 | -LL | #[label(typeck::label, foo = "...")] - | ^^^^^^^^^^^ +LL | #[label(compiletest::label, foo = "...")] + | ^^^^^^^^^^^ error: `#[label(foo(...))]` is not a valid attribute - --> $DIR/diagnostic-derive.rs:532:28 + --> $DIR/diagnostic-derive.rs:532:33 | -LL | #[label(typeck::label, foo("..."))] - | ^^^^^^^^^^ +LL | #[label(compiletest::label, foo("..."))] + | ^^^^^^^^^^ error: `#[primary_span]` is not a valid attribute --> $DIR/diagnostic-derive.rs:545:5 @@ -383,73 +383,73 @@ LL | #[primary_span] error: `#[error(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:565:1 | -LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[error(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:565:1 | -LL | / #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | / #[error(compiletest::example, code = "E0123")] LL | | LL | | LL | | LL | | struct ErrorAttribute {} | |________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[warn_(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:572:1 | -LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[warn_(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:572:1 | -LL | / #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | / #[warn_(compiletest::example, code = "E0123")] LL | | LL | | LL | | LL | | struct WarnAttribute {} | |_______________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[lint(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:579:1 | -LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[lint(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:579:1 | -LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | / #[lint(compiletest::example, code = "E0123")] LL | | LL | | LL | | LL | | struct LintAttributeOnSessionDiag {} | |____________________________________^ | - = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis::example_error)]` error: `#[lint(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:586:1 | -LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[lint(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[lint(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:586:1 | -LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[lint(compiletest::example, code = "E0123")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: diagnostic slug not specified --> $DIR/diagnostic-derive.rs:586:1 | -LL | / #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | / #[lint(compiletest::example, code = "E0123")] LL | | LL | | LL | | @@ -457,19 +457,19 @@ LL | | LL | | struct LintAttributeOnLintDiag {} | |_________________________________^ | - = help: specify the slug as the first argument to the attribute, such as `#[diag(typeck::example_error)]` + = help: specify the slug as the first argument to the attribute, such as `#[diag(compiletest::example)]` error: specified multiple times - --> $DIR/diagnostic-derive.rs:596:52 + --> $DIR/diagnostic-derive.rs:596:57 | -LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")] - | ^^^^^^^^^^^^ +LL | #[suggestion(compiletest::suggestion, code = "...", code = ",,,")] + | ^^^^^^^^^^^^ | note: previously specified here - --> $DIR/diagnostic-derive.rs:596:38 + --> $DIR/diagnostic-derive.rs:596:43 | -LL | #[suggestion(typeck::suggestion, code = "...", code = ",,,")] - | ^^^^^^^^^^^^ +LL | #[suggestion(compiletest::suggestion, code = "...", code = ",,,")] + | ^^^^^^^^^^^^ error: wrong types for suggestion --> $DIR/diagnostic-derive.rs:605:24 @@ -490,14 +490,14 @@ LL | suggestion: (Span,), error: suggestion without `code = "..."` --> $DIR/diagnostic-derive.rs:620:5 | -LL | #[suggestion(typeck::suggestion)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[suggestion(compiletest::suggestion)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `#[multipart_suggestion(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:627:1 | -LL | #[multipart_suggestion(typeck::suggestion)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[multipart_suggestion(compiletest::suggestion)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider creating a `Subdiagnostic` instead @@ -512,16 +512,16 @@ LL | #[multipart_suggestion()] error: `#[multipart_suggestion(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:634:5 | -LL | #[multipart_suggestion(typeck::suggestion)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[multipart_suggestion(compiletest::suggestion)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider creating a `Subdiagnostic` instead error: `#[suggestion(...)]` is not a valid attribute --> $DIR/diagnostic-derive.rs:642:1 | -LL | #[suggestion(typeck::suggestion, code = "...")] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +LL | #[suggestion(compiletest::suggestion, code = "...")] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: `#[label]` and `#[suggestion]` can only be applied to fields @@ -536,7 +536,7 @@ LL | #[label] error: cannot find attribute `nonsense` in this scope --> $DIR/diagnostic-derive.rs:55:3 | -LL | #[nonsense(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | #[nonsense(compiletest::example, code = "E0123")] | ^^^^^^^^ error: cannot find attribute `nonsense` in this scope @@ -548,31 +548,31 @@ LL | #[nonsense] error: cannot find attribute `error` in this scope --> $DIR/diagnostic-derive.rs:565:3 | -LL | #[error(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | #[error(compiletest::example, code = "E0123")] | ^^^^^ error: cannot find attribute `warn_` in this scope --> $DIR/diagnostic-derive.rs:572:3 | -LL | #[warn_(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | #[warn_(compiletest::example, code = "E0123")] | ^^^^^ help: a built-in attribute with a similar name exists: `warn` error: cannot find attribute `lint` in this scope --> $DIR/diagnostic-derive.rs:579:3 | -LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | #[lint(compiletest::example, code = "E0123")] | ^^^^ help: a built-in attribute with a similar name exists: `link` error: cannot find attribute `lint` in this scope --> $DIR/diagnostic-derive.rs:586:3 | -LL | #[lint(typeck::ambiguous_lifetime_bound, code = "E0123")] +LL | #[lint(compiletest::example, code = "E0123")] | ^^^^ help: a built-in attribute with a similar name exists: `link` error: cannot find attribute `multipart_suggestion` in this scope --> $DIR/diagnostic-derive.rs:627:3 | -LL | #[multipart_suggestion(typeck::suggestion)] +LL | #[multipart_suggestion(compiletest::suggestion)] | ^^^^^^^^^^^^^^^^^^^^ error: cannot find attribute `multipart_suggestion` in this scope @@ -584,7 +584,7 @@ LL | #[multipart_suggestion()] error: cannot find attribute `multipart_suggestion` in this scope --> $DIR/diagnostic-derive.rs:634:7 | -LL | #[multipart_suggestion(typeck::suggestion)] +LL | #[multipart_suggestion(compiletest::suggestion)] | ^^^^^^^^^^^^^^^^^^^^ error[E0425]: cannot find value `nonsense` in module `rustc_errors::fluent` diff --git a/src/test/ui/abi/x86stdcall.rs b/src/test/ui/abi/x86stdcall.rs index 868923e5932..d1cf1319fb0 100644 --- a/src/test/ui/abi/x86stdcall.rs +++ b/src/test/ui/abi/x86stdcall.rs @@ -1,17 +1,15 @@ // run-pass -// ignore-wasm32-bare no libc to test ffi with -// ignore-sgx no libc +// only-windows // GetLastError doesn't seem to work with stack switching #[cfg(windows)] mod kernel32 { - extern "system" { - pub fn SetLastError(err: usize); - pub fn GetLastError() -> usize; - } + extern "system" { + pub fn SetLastError(err: usize); + pub fn GetLastError() -> usize; + } } - #[cfg(windows)] pub fn main() { unsafe { @@ -22,17 +20,3 @@ pub fn main() { assert_eq!(expected, actual); } } - -#[cfg(any(target_os = "android", - target_os = "dragonfly", - target_os = "emscripten", - target_os = "freebsd", - target_os = "fuchsia", - target_os = "illumos", - target_os = "linux", - target_os = "macos", - target_os = "netbsd", - target_os = "openbsd", - target_os = "solaris", - target_os = "vxworks"))] -pub fn main() { } diff --git a/src/test/ui/abi/x86stdcall2.rs b/src/test/ui/abi/x86stdcall2.rs index 563e3aba632..4d508ecb242 100644 --- a/src/test/ui/abi/x86stdcall2.rs +++ b/src/test/ui/abi/x86stdcall2.rs @@ -1,4 +1,5 @@ // run-pass +// only-windows #![allow(non_camel_case_types)] pub type HANDLE = usize; @@ -7,20 +8,16 @@ pub type SIZE_T = u32; pub type LPVOID = usize; pub type BOOL = u8; -#[cfg(windows)] mod kernel32 { - use super::{HANDLE, DWORD, SIZE_T, LPVOID, BOOL}; + use super::{BOOL, DWORD, HANDLE, LPVOID, SIZE_T}; extern "system" { pub fn GetProcessHeap() -> HANDLE; - pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) - -> LPVOID; + pub fn HeapAlloc(hHeap: HANDLE, dwFlags: DWORD, dwBytes: SIZE_T) -> LPVOID; pub fn HeapFree(hHeap: HANDLE, dwFlags: DWORD, lpMem: LPVOID) -> BOOL; } } - -#[cfg(windows)] pub fn main() { let heap = unsafe { kernel32::GetProcessHeap() }; let mem = unsafe { kernel32::HeapAlloc(heap, 0, 100) }; @@ -28,6 +25,3 @@ pub fn main() { let res = unsafe { kernel32::HeapFree(heap, 0, mem) }; assert!(res != 0); } - -#[cfg(not(windows))] -pub fn main() { } diff --git a/src/test/ui/deriving/deriving-default-enum.rs b/src/test/ui/deriving/deriving-default-enum.rs index d1a81c72c2f..1c7a501edc7 100644 --- a/src/test/ui/deriving/deriving-default-enum.rs +++ b/src/test/ui/deriving/deriving-default-enum.rs @@ -12,6 +12,16 @@ enum Foo { Beta(NotDefault), } +// #[default] on a generic enum does not add `Default` bounds to the type params. +#[derive(Default)] +enum MyOption<T> { + #[default] + None, + #[allow(dead_code)] + Some(T), +} + fn main() { assert_eq!(Foo::default(), Foo::Alpha); + assert!(matches!(MyOption::<NotDefault>::default(), MyOption::None)); } diff --git a/src/test/ui/impl-trait/in-trait/issue-102571.rs b/src/test/ui/impl-trait/in-trait/issue-102571.rs new file mode 100644 index 00000000000..61c91e64417 --- /dev/null +++ b/src/test/ui/impl-trait/in-trait/issue-102571.rs @@ -0,0 +1,24 @@ +#![feature(return_position_impl_trait_in_trait)] +#![allow(incomplete_features)] + +use std::fmt::Display; +use std::ops::Deref; + +trait Foo { + fn bar(self) -> impl Deref<Target = impl Display + ?Sized>; +} + +struct A; + +impl Foo for A { + fn bar(self) -> &'static str { + "Hello, world" + } +} + +fn foo<T: Foo>(t: T) { + let () = t.bar(); + //~^ ERROR mismatched types +} + +fn main() {} diff --git a/src/test/ui/impl-trait/in-trait/issue-102571.stderr b/src/test/ui/impl-trait/in-trait/issue-102571.stderr new file mode 100644 index 00000000000..87219941d91 --- /dev/null +++ b/src/test/ui/impl-trait/in-trait/issue-102571.stderr @@ -0,0 +1,14 @@ +error[E0308]: mismatched types + --> $DIR/issue-102571.rs:20:9 + | +LL | let () = t.bar(); + | ^^ ------- this expression has type `impl Deref<Target = impl std::fmt::Display + ?Sized>` + | | + | expected associated type, found `()` + | + = note: expected associated type `impl Deref<Target = impl std::fmt::Display + ?Sized>` + found unit type `()` + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lint/auxiliary/trivial-cast-ice.rs b/src/test/ui/lint/auxiliary/trivial-cast-ice.rs new file mode 100644 index 00000000000..ab2332d0656 --- /dev/null +++ b/src/test/ui/lint/auxiliary/trivial-cast-ice.rs @@ -0,0 +1,7 @@ +#[macro_export] +macro_rules! foo { + () => { + let x: &Option<i32> = &Some(1); + let _y = x as *const Option<i32>; + } +} diff --git a/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr b/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr index bc0c5330324..e31d14c5596 100644 --- a/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr +++ b/src/test/ui/lint/redundant-semicolon/redundant-semi-proc-macro.stderr @@ -1,4 +1,4 @@ -TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..489) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(487..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..506) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(504..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }] +TokenStream [Ident { ident: "fn", span: #0 bytes(198..200) }, Ident { ident: "span_preservation", span: #0 bytes(201..218) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(218..220) }, Group { delimiter: Brace, stream: TokenStream [Ident { ident: "let", span: #0 bytes(228..231) }, Ident { ident: "tst", span: #0 bytes(232..235) }, Punct { ch: '=', spacing: Alone, span: #0 bytes(236..237) }, Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(238..241) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(241..242) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(242..243) }, Ident { ident: "match", span: #0 bytes(289..294) }, Ident { ident: "tst", span: #0 bytes(295..298) }, Group { delimiter: Brace, stream: TokenStream [Literal { kind: Integer, symbol: "123", suffix: None, span: #0 bytes(483..486) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(487..488) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(488..489) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(490..492) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(492..493) }, Ident { ident: "_", span: #0 bytes(502..503) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(504..505) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(505..506) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(507..509) }], span: #0 bytes(299..515) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(515..516) }, Punct { ch: ';', spacing: Joint, span: #0 bytes(516..517) }, Punct { ch: ';', spacing: Alone, span: #0 bytes(517..518) }], span: #0 bytes(222..562) }] error: unnecessary trailing semicolon --> $DIR/redundant-semi-proc-macro.rs:9:19 | diff --git a/src/test/ui/lint/trivial-cast-ice.rs b/src/test/ui/lint/trivial-cast-ice.rs new file mode 100644 index 00000000000..f781fab2212 --- /dev/null +++ b/src/test/ui/lint/trivial-cast-ice.rs @@ -0,0 +1,12 @@ +// aux-build:trivial-cast-ice.rs +// check-pass + +// Demonstrates the ICE in #102561 + +#![deny(trivial_casts)] + +extern crate trivial_cast_ice; + +fn main() { + trivial_cast_ice::foo!(); +} diff --git a/src/test/ui/macros/macros-nonfatal-errors.rs b/src/test/ui/macros/macros-nonfatal-errors.rs index e7a01f105de..140cc5b0fd8 100644 --- a/src/test/ui/macros/macros-nonfatal-errors.rs +++ b/src/test/ui/macros/macros-nonfatal-errors.rs @@ -116,3 +116,24 @@ fn main() { trace_macros!(invalid); //~ ERROR } + +/// Check that `#[derive(Default)]` does use a `T : Default` bound when the +/// `#[default]` variant is `#[non_exhaustive]` (should this end up allowed). +const _: () = { + #[derive(Default)] + enum NonExhaustiveDefaultGeneric<T> { + #[default] + #[non_exhaustive] + Foo, //~ ERROR default variant must be exhaustive + Bar(T), + } + + fn assert_impls_default<T: Default>() {} + + enum NotDefault {} + + // Note: the `derive(Default)` currently bails early enough for trait-checking + // not to happen. Should it bail late enough, or even pass, make sure to + // assert that the following line fails. + let _ = assert_impls_default::<NonExhaustiveDefaultGeneric<NotDefault>>; +}; diff --git a/src/test/ui/macros/macros-nonfatal-errors.stderr b/src/test/ui/macros/macros-nonfatal-errors.stderr index b3c6d07f967..d42f6c179b7 100644 --- a/src/test/ui/macros/macros-nonfatal-errors.stderr +++ b/src/test/ui/macros/macros-nonfatal-errors.stderr @@ -215,11 +215,21 @@ error: trace_macros! accepts only `true` or `false` LL | trace_macros!(invalid); | ^^^^^^^^^^^^^^^^^^^^^^ +error: default variant must be exhaustive + --> $DIR/macros-nonfatal-errors.rs:127:9 + | +LL | #[non_exhaustive] + | ----------------- declared `#[non_exhaustive]` here +LL | Foo, + | ^^^ + | + = help: consider a manual implementation of `Default` + error: cannot find macro `llvm_asm` in this scope --> $DIR/macros-nonfatal-errors.rs:99:5 | LL | llvm_asm!(invalid); | ^^^^^^^^ -error: aborting due to 27 previous errors +error: aborting due to 28 previous errors diff --git a/src/test/ui/proc-macro/attr-complex-fn.stdout b/src/test/ui/proc-macro/attr-complex-fn.stdout index fc69a13ddb9..b12eb587fc7 100644 --- a/src/test/ui/proc-macro/attr-complex-fn.stdout +++ b/src/test/ui/proc-macro/attr-complex-fn.stdout @@ -53,12 +53,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '>', spacing: Joint, - span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0), + span: $DIR/attr-complex-fn.rs:19:36: 19:37 (#0), }, Punct { ch: '>', spacing: Joint, - span: $DIR/attr-complex-fn.rs:19:36: 19:38 (#0), + span: $DIR/attr-complex-fn.rs:19:37: 19:38 (#0), }, Punct { ch: '>', diff --git a/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout b/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout index 4de8746a1b4..b88fbd3e897 100644 --- a/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout +++ b/src/test/ui/proc-macro/capture-macro-rules-invoke.stdout @@ -177,12 +177,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0), + span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:17 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:45:16: 45:18 (#0), + span: $DIR/capture-macro-rules-invoke.rs:45:17: 45:18 (#0), }, Ident { ident: "option", @@ -191,12 +191,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0), + span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:25 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:45:24: 45:26 (#0), + span: $DIR/capture-macro-rules-invoke.rs:45:25: 45:26 (#0), }, Ident { ident: "Option", @@ -231,12 +231,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0), + span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:25 (#0), }, Punct { ch: ':', spacing: Alone, - span: $DIR/capture-macro-rules-invoke.rs:46:24: 46:26 (#0), + span: $DIR/capture-macro-rules-invoke.rs:46:25: 46:26 (#0), }, Ident { ident: "path", diff --git a/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs b/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs index fd34eb974c0..102bd6b7b17 100644 --- a/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs +++ b/src/test/ui/proc-macro/debug/dump-debug-span-debug.rs @@ -2,6 +2,7 @@ // aux-build:macro-dump-debug.rs // compile-flags: -Z span-debug + extern crate macro_dump_debug; use macro_dump_debug::dump_debug; @@ -9,7 +10,11 @@ dump_debug! { ident // ident r#ident // raw ident , // alone punct - ==> // joint punct + && // joint punct, two-char op + ||> // joint punct, two-char op + one-char op + ||<< // joint punct, two-char op + two-char op + ..= // joint punct, three-char op + <<=! // joint punct, three-char op + one-char-op () // empty group [_] // nonempty group diff --git a/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr b/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr index 2c05bdbc492..fa65cbbf1ea 100644 --- a/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr +++ b/src/test/ui/proc-macro/debug/dump-debug-span-debug.stderr @@ -1,166 +1,231 @@ -TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }] +TokenStream [Ident { ident: "ident", span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0) }, Ident { ident: "r#ident", span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0) }, Punct { ch: ',', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0) }, Punct { ch: '&', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0) }, Punct { ch: '&', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0) }, Punct { ch: '>', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0) }, Punct { ch: '|', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0) }, Punct { ch: '<', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0) }, Punct { ch: '.', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0) }, Punct { ch: '=', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0) }, Punct { ch: '<', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0) }, Punct { ch: '=', spacing: Joint, span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0) }, Punct { ch: '!', spacing: Alone, span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0) }], span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0) }, Literal { kind: Integer, symbol: "0", suffix: None, span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0) }, Literal { kind: Str, symbol: "S", suffix: None, span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0) }, Literal { kind: Char, symbol: "C", suffix: None, span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0) }, Literal { kind: Byte, symbol: "B", suffix: None, span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0) }] TokenStream [ Ident { ident: "ident", - span: $DIR/dump-debug-span-debug.rs:9:5: 9:10 (#0), + span: $DIR/dump-debug-span-debug.rs:10:5: 10:10 (#0), }, Ident { ident: "r#ident", - span: $DIR/dump-debug-span-debug.rs:10:5: 10:12 (#0), + span: $DIR/dump-debug-span-debug.rs:11:5: 11:12 (#0), }, Punct { ch: ',', spacing: Alone, - span: $DIR/dump-debug-span-debug.rs:11:5: 11:6 (#0), + span: $DIR/dump-debug-span-debug.rs:12:5: 12:6 (#0), + }, + Punct { + ch: '&', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:13:5: 13:6 (#0), + }, + Punct { + ch: '&', + spacing: Alone, + span: $DIR/dump-debug-span-debug.rs:13:6: 13:7 (#0), + }, + Punct { + ch: '|', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:14:5: 14:6 (#0), + }, + Punct { + ch: '|', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0), + }, + Punct { + ch: '>', + spacing: Alone, + span: $DIR/dump-debug-span-debug.rs:14:7: 14:8 (#0), + }, + Punct { + ch: '|', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:15:5: 15:6 (#0), + }, + Punct { + ch: '|', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:15:6: 15:7 (#0), + }, + Punct { + ch: '<', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:15:7: 15:8 (#0), + }, + Punct { + ch: '<', + spacing: Alone, + span: $DIR/dump-debug-span-debug.rs:15:8: 15:9 (#0), + }, + Punct { + ch: '.', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:16:5: 16:6 (#0), + }, + Punct { + ch: '.', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:16:6: 16:7 (#0), }, Punct { ch: '=', + spacing: Alone, + span: $DIR/dump-debug-span-debug.rs:16:7: 16:8 (#0), + }, + Punct { + ch: '<', spacing: Joint, - span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0), + span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0), + }, + Punct { + ch: '<', + spacing: Joint, + span: $DIR/dump-debug-span-debug.rs:17:6: 17:7 (#0), }, Punct { ch: '=', spacing: Joint, - span: $DIR/dump-debug-span-debug.rs:12:5: 12:7 (#0), + span: $DIR/dump-debug-span-debug.rs:17:7: 17:8 (#0), }, Punct { - ch: '>', + ch: '!', spacing: Alone, - span: $DIR/dump-debug-span-debug.rs:12:7: 12:8 (#0), + span: $DIR/dump-debug-span-debug.rs:17:8: 17:9 (#0), }, Group { delimiter: Parenthesis, stream: TokenStream [], - span: $DIR/dump-debug-span-debug.rs:13:5: 13:7 (#0), + span: $DIR/dump-debug-span-debug.rs:18:5: 18:7 (#0), }, Group { delimiter: Bracket, stream: TokenStream [ Ident { ident: "_", - span: $DIR/dump-debug-span-debug.rs:14:6: 14:7 (#0), + span: $DIR/dump-debug-span-debug.rs:19:6: 19:7 (#0), }, ], - span: $DIR/dump-debug-span-debug.rs:14:5: 14:8 (#0), + span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0), }, Literal { kind: Integer, symbol: "0", suffix: None, - span: $DIR/dump-debug-span-debug.rs:17:5: 17:6 (#0), + span: $DIR/dump-debug-span-debug.rs:22:5: 22:6 (#0), }, Literal { kind: Float, symbol: "1.0", suffix: None, - span: $DIR/dump-debug-span-debug.rs:18:5: 18:8 (#0), + span: $DIR/dump-debug-span-debug.rs:23:5: 23:8 (#0), }, Literal { kind: Str, symbol: "S", suffix: None, - span: $DIR/dump-debug-span-debug.rs:19:5: 19:8 (#0), + span: $DIR/dump-debug-span-debug.rs:24:5: 24:8 (#0), }, Literal { kind: ByteStr, symbol: "B", suffix: None, - span: $DIR/dump-debug-span-debug.rs:20:5: 20:9 (#0), + span: $DIR/dump-debug-span-debug.rs:25:5: 25:9 (#0), }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, - span: $DIR/dump-debug-span-debug.rs:21:5: 21:9 (#0), + span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0), }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, - span: $DIR/dump-debug-span-debug.rs:22:5: 22:13 (#0), + span: $DIR/dump-debug-span-debug.rs:27:5: 27:13 (#0), }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, - span: $DIR/dump-debug-span-debug.rs:23:5: 23:11 (#0), + span: $DIR/dump-debug-span-debug.rs:28:5: 28:11 (#0), }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, - span: $DIR/dump-debug-span-debug.rs:24:5: 24:15 (#0), + span: $DIR/dump-debug-span-debug.rs:29:5: 29:15 (#0), }, Literal { kind: Char, symbol: "C", suffix: None, - span: $DIR/dump-debug-span-debug.rs:25:5: 25:8 (#0), + span: $DIR/dump-debug-span-debug.rs:30:5: 30:8 (#0), }, Literal { kind: Byte, symbol: "B", suffix: None, - span: $DIR/dump-debug-span-debug.rs:26:5: 26:9 (#0), + span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0), }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:29:5: 29:7 (#0), + span: $DIR/dump-debug-span-debug.rs:34:5: 34:7 (#0), }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:30:5: 30:9 (#0), + span: $DIR/dump-debug-span-debug.rs:35:5: 35:9 (#0), }, Literal { kind: Str, symbol: "S", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:31:5: 31:9 (#0), + span: $DIR/dump-debug-span-debug.rs:36:5: 36:9 (#0), }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:32:5: 32:10 (#0), + span: $DIR/dump-debug-span-debug.rs:37:5: 37:10 (#0), }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:33:5: 33:10 (#0), + span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0), }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:34:5: 34:14 (#0), + span: $DIR/dump-debug-span-debug.rs:39:5: 39:14 (#0), }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:35:5: 35:12 (#0), + span: $DIR/dump-debug-span-debug.rs:40:5: 40:12 (#0), }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:36:5: 36:16 (#0), + span: $DIR/dump-debug-span-debug.rs:41:5: 41:16 (#0), }, Literal { kind: Char, symbol: "C", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:37:5: 37:9 (#0), + span: $DIR/dump-debug-span-debug.rs:42:5: 42:9 (#0), }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), - span: $DIR/dump-debug-span-debug.rs:38:5: 38:10 (#0), + span: $DIR/dump-debug-span-debug.rs:43:5: 43:10 (#0), }, ] diff --git a/src/test/ui/proc-macro/debug/dump-debug.stderr b/src/test/ui/proc-macro/debug/dump-debug.stderr index 0aedefd4e60..db422b6012a 100644 --- a/src/test/ui/proc-macro/debug/dump-debug.stderr +++ b/src/test/ui/proc-macro/debug/dump-debug.stderr @@ -1,4 +1,4 @@ -TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }] +TokenStream [Ident { ident: "ident", span: #0 bytes(130..135) }, Ident { ident: "r#ident", span: #0 bytes(151..158) }, Punct { ch: ',', spacing: Alone, span: #0 bytes(176..177) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(203..204) }, Punct { ch: '=', spacing: Joint, span: #0 bytes(204..205) }, Punct { ch: '>', spacing: Alone, span: #0 bytes(205..206) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: #0 bytes(230..232) }, Group { delimiter: Bracket, stream: TokenStream [Ident { ident: "_", span: #0 bytes(258..259) }], span: #0 bytes(257..260) }, Literal { kind: Integer, symbol: "0", suffix: None, span: #0 bytes(315..316) }, Literal { kind: Float, symbol: "1.0", suffix: None, span: #0 bytes(321..324) }, Literal { kind: Str, symbol: "S", suffix: None, span: #0 bytes(329..332) }, Literal { kind: ByteStr, symbol: "B", suffix: None, span: #0 bytes(337..341) }, Literal { kind: StrRaw(0), symbol: "R", suffix: None, span: #0 bytes(346..350) }, Literal { kind: StrRaw(2), symbol: "R", suffix: None, span: #0 bytes(355..363) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: None, span: #0 bytes(368..374) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: None, span: #0 bytes(379..389) }, Literal { kind: Char, symbol: "C", suffix: None, span: #0 bytes(394..397) }, Literal { kind: Byte, symbol: "B", suffix: None, span: #0 bytes(402..406) }, Literal { kind: Integer, symbol: "0", suffix: Some("q"), span: #0 bytes(437..439) }, Literal { kind: Float, symbol: "1.0", suffix: Some("q"), span: #0 bytes(444..448) }, Literal { kind: Str, symbol: "S", suffix: Some("q"), span: #0 bytes(453..457) }, Literal { kind: ByteStr, symbol: "B", suffix: Some("q"), span: #0 bytes(462..467) }, Literal { kind: StrRaw(0), symbol: "R", suffix: Some("q"), span: #0 bytes(472..477) }, Literal { kind: StrRaw(2), symbol: "R", suffix: Some("q"), span: #0 bytes(482..491) }, Literal { kind: ByteStrRaw(0), symbol: "BR", suffix: Some("q"), span: #0 bytes(496..503) }, Literal { kind: ByteStrRaw(2), symbol: "BR", suffix: Some("q"), span: #0 bytes(508..519) }, Literal { kind: Char, symbol: "C", suffix: Some("q"), span: #0 bytes(524..528) }, Literal { kind: Byte, symbol: "B", suffix: Some("q"), span: #0 bytes(533..538) }] TokenStream [ Ident { ident: "ident", @@ -16,12 +16,12 @@ TokenStream [ Punct { ch: '=', spacing: Joint, - span: #0 bytes(203..205), + span: #0 bytes(203..204), }, Punct { ch: '=', spacing: Joint, - span: #0 bytes(203..205), + span: #0 bytes(204..205), }, Punct { ch: '>', diff --git a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout index c0c9ed72c5a..2622c005d93 100644 --- a/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout +++ b/src/test/ui/proc-macro/dollar-crate-issue-57089.stdout @@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:29 (#4), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate-issue-57089.rs:17:28: 17:30 (#4), + span: $DIR/dollar-crate-issue-57089.rs:17:29: 17:30 (#4), }, Ident { ident: "S", @@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:25 (#4), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate-issue-57089.rs:21:24: 21:26 (#4), + span: $DIR/dollar-crate-issue-57089.rs:21:25: 21:26 (#4), }, Ident { ident: "S", diff --git a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout index e6148a687fd..a91908239c3 100644 --- a/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout +++ b/src/test/ui/proc-macro/dollar-crate-issue-62325.stdout @@ -30,12 +30,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:31 (#4), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate-issue-62325.rs:19:30: 19:32 (#4), + span: $DIR/dollar-crate-issue-62325.rs:19:31: 19:32 (#4), }, Ident { ident: "S", @@ -85,12 +85,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:31 (#12), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:21:30: 21:32 (#12), + span: $DIR/auxiliary/dollar-crate-external.rs:21:31: 21:32 (#12), }, Ident { ident: "S", diff --git a/src/test/ui/proc-macro/dollar-crate.stdout b/src/test/ui/proc-macro/dollar-crate.stdout index d01fcb9d0e4..4e169d47e1a 100644 --- a/src/test/ui/proc-macro/dollar-crate.stdout +++ b/src/test/ui/proc-macro/dollar-crate.stdout @@ -18,12 +18,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate.rs:20:32: 20:34 (#4), + span: $DIR/dollar-crate.rs:20:32: 20:33 (#4), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate.rs:20:32: 20:34 (#4), + span: $DIR/dollar-crate.rs:20:33: 20:34 (#4), }, Ident { ident: "S", @@ -58,12 +58,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate.rs:24:28: 24:30 (#4), + span: $DIR/dollar-crate.rs:24:28: 24:29 (#4), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate.rs:24:28: 24:30 (#4), + span: $DIR/dollar-crate.rs:24:29: 24:30 (#4), }, Ident { ident: "S", @@ -98,12 +98,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/dollar-crate.rs:27:28: 27:30 (#4), + span: $DIR/dollar-crate.rs:27:28: 27:29 (#4), }, Punct { ch: ':', spacing: Alone, - span: $DIR/dollar-crate.rs:27:28: 27:30 (#4), + span: $DIR/dollar-crate.rs:27:29: 27:30 (#4), }, Ident { ident: "S", @@ -138,12 +138,12 @@ PRINT-BANG INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:29 (#15), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:7:28: 7:30 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:7:29: 7:30 (#15), }, Ident { ident: "S", @@ -178,12 +178,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:25 (#15), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:11:24: 11:26 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:11:25: 11:26 (#15), }, Ident { ident: "S", @@ -218,12 +218,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: ':', spacing: Joint, - span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:25 (#15), }, Punct { ch: ':', spacing: Alone, - span: $DIR/auxiliary/dollar-crate-external.rs:14:24: 14:26 (#15), + span: $DIR/auxiliary/dollar-crate-external.rs:14:25: 14:26 (#15), }, Ident { ident: "S", diff --git a/src/test/ui/proc-macro/inner-attrs.stdout b/src/test/ui/proc-macro/inner-attrs.stdout index 490fc02f510..ee8adf0b4a9 100644 --- a/src/test/ui/proc-macro/inner-attrs.stdout +++ b/src/test/ui/proc-macro/inner-attrs.stdout @@ -627,12 +627,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '=', spacing: Joint, - span: $DIR/inner-attrs.rs:39:15: 39:17 (#0), + span: $DIR/inner-attrs.rs:39:15: 39:16 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/inner-attrs.rs:39:15: 39:17 (#0), + span: $DIR/inner-attrs.rs:39:16: 39:17 (#0), }, Group { delimiter: Brace, diff --git a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout index c81fa201cbc..83afd0d3eae 100644 --- a/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout +++ b/src/test/ui/proc-macro/issue-75930-derive-cfg.stdout @@ -489,12 +489,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:33 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:33:32: 33:34 (#0), + span: $DIR/issue-75930-derive-cfg.rs:33:33: 33:34 (#0), }, Group { delimiter: Brace, @@ -567,12 +567,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0), + span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0), + span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0), }, Group { delimiter: Brace, @@ -591,12 +591,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0), }, Group { delimiter: Brace, @@ -1519,12 +1519,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0), + span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:61 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:34:60: 34:62 (#0), + span: $DIR/issue-75930-derive-cfg.rs:34:61: 34:62 (#0), }, Group { delimiter: Brace, @@ -1543,12 +1543,12 @@ PRINT-DERIVE INPUT (DEBUG): TokenStream [ Punct { ch: '=', spacing: Joint, - span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:16 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-75930-derive-cfg.rs:35:15: 35:17 (#0), + span: $DIR/issue-75930-derive-cfg.rs:35:16: 35:17 (#0), }, Group { delimiter: Brace, diff --git a/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout b/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout index 5493f9c7b60..09eb33f7e31 100644 --- a/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout +++ b/src/test/ui/proc-macro/issue-76182-leading-vert-pat.stdout @@ -41,12 +41,12 @@ PRINT-ATTR INPUT (DEBUG): TokenStream [ Punct { ch: '=', spacing: Joint, - span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0), + span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:22 (#0), }, Punct { ch: '>', spacing: Alone, - span: $DIR/issue-76182-leading-vert-pat.rs:15:21: 15:23 (#0), + span: $DIR/issue-76182-leading-vert-pat.rs:15:22: 15:23 (#0), }, Group { delimiter: Parenthesis, diff --git a/src/test/ui/proc-macro/meta-macro-hygiene.stdout b/src/test/ui/proc-macro/meta-macro-hygiene.stdout index 5d04fe1e3de..2494af1208f 100644 --- a/src/test/ui/proc-macro/meta-macro-hygiene.stdout +++ b/src/test/ui/proc-macro/meta-macro-hygiene.stdout @@ -1,5 +1,5 @@ Def site: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) -Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:43: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }] +Input: TokenStream [Ident { ident: "$crate", span: $DIR/meta-macro-hygiene.rs:24:37: 24:43 (#4) }, Punct { ch: ':', spacing: Joint, span: $DIR/meta-macro-hygiene.rs:24:43: 24:44 (#4) }, Punct { ch: ':', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:44: 24:45 (#4) }, Ident { ident: "dummy", span: $DIR/meta-macro-hygiene.rs:24:45: 24:50 (#4) }, Punct { ch: '!', spacing: Alone, span: $DIR/meta-macro-hygiene.rs:24:50: 24:51 (#4) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/meta-macro-hygiene.rs:24:51: 24:53 (#4) }] Respanned: TokenStream [Ident { ident: "$crate", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Joint, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: ':', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Ident { ident: "dummy", span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Punct { ch: '!', spacing: Alone, span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }, Group { delimiter: Parenthesis, stream: TokenStream [], span: $DIR/auxiliary/make-macro.rs:7:9: 7:56 (#5) }] #![feature /* 0#0 */(prelude_import)] // aux-build:make-macro.rs diff --git a/src/test/ui/proc-macro/three-equals.stderr b/src/test/ui/proc-macro/three-equals.stderr index 1ce5e02bd82..9cdb2a21b04 100644 --- a/src/test/ui/proc-macro/three-equals.stderr +++ b/src/test/ui/proc-macro/three-equals.stderr @@ -8,16 +8,16 @@ LL | three_equals!(==); = note: this error originates in the macro `three_equals` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected EOF, found `=`. - --> $DIR/three-equals.rs:15:21 + --> $DIR/three-equals.rs:15:22 | LL | three_equals!(=====); - | ^^ + | ^ | note: last good input was here --> $DIR/three-equals.rs:15:21 | LL | three_equals!(=====); - | ^^ + | ^ = help: input must be: `===` error: expected `=`, found `abc`. diff --git a/src/test/ui/process/process-panic-after-fork.rs b/src/test/ui/process/process-panic-after-fork.rs index 08b30b600e7..d0a938c03e8 100644 --- a/src/test/ui/process/process-panic-after-fork.rs +++ b/src/test/ui/process/process-panic-after-fork.rs @@ -6,6 +6,7 @@ // ignore-emscripten no processes // ignore-sgx no processes // ignore-android: FIXME(#85261) +// ignore-fuchsia no fork #![feature(rustc_private)] #![feature(never_type)] diff --git a/src/test/ui/simd/target-feature-mixup.rs b/src/test/ui/simd/target-feature-mixup.rs index 6d7688191b7..5dd163715eb 100644 --- a/src/test/ui/simd/target-feature-mixup.rs +++ b/src/test/ui/simd/target-feature-mixup.rs @@ -5,6 +5,7 @@ // ignore-emscripten // ignore-sgx no processes +// ignore-fuchsia must translate zircon signal to SIGILL, FIXME (#58590) #![feature(repr_simd, target_feature, cfg_target_feature)] #![feature(avx512_target_feature)] diff --git a/src/test/ui/suggestions/sugg-else-for-closure.fixed b/src/test/ui/suggestions/sugg-else-for-closure.fixed new file mode 100644 index 00000000000..cf381d9da8b --- /dev/null +++ b/src/test/ui/suggestions/sugg-else-for-closure.fixed @@ -0,0 +1,8 @@ +// run-rustfix + +fn main() { + let x = "com.example.app"; + let y: Option<&str> = None; + let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap()); + //~^ ERROR: mismatched types [E0308] +} diff --git a/src/test/ui/suggestions/sugg-else-for-closure.rs b/src/test/ui/suggestions/sugg-else-for-closure.rs new file mode 100644 index 00000000000..540ced91fc9 --- /dev/null +++ b/src/test/ui/suggestions/sugg-else-for-closure.rs @@ -0,0 +1,8 @@ +// run-rustfix + +fn main() { + let x = "com.example.app"; + let y: Option<&str> = None; + let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); + //~^ ERROR: mismatched types [E0308] +} diff --git a/src/test/ui/suggestions/sugg-else-for-closure.stderr b/src/test/ui/suggestions/sugg-else-for-closure.stderr new file mode 100644 index 00000000000..55a0eee1817 --- /dev/null +++ b/src/test/ui/suggestions/sugg-else-for-closure.stderr @@ -0,0 +1,23 @@ +error[E0308]: mismatched types + --> $DIR/sugg-else-for-closure.rs:6:26 + | +LL | let _s = y.unwrap_or(|| x.split('.').nth(1).unwrap()); + | --------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `&str`, found closure + | | + | arguments to this function are incorrect + | + = note: expected reference `&str` + found closure `[closure@$DIR/sugg-else-for-closure.rs:6:26: 6:28]` +note: associated function defined here + --> $SRC_DIR/core/src/option.rs:LL:COL + | +LL | pub const fn unwrap_or(self, default: T) -> T + | ^^^^^^^^^ +help: try calling `unwrap_or_else` instead + | +LL | let _s = y.unwrap_or_else(|| x.split('.').nth(1).unwrap()); + | +++++ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/test-attrs/test-on-not-fn.stderr b/src/test/ui/test-attrs/test-on-not-fn.stderr index 23efd5bc0d9..fc2c5f62bed 100644 --- a/src/test/ui/test-attrs/test-on-not-fn.stderr +++ b/src/test/ui/test-attrs/test-on-not-fn.stderr @@ -2,7 +2,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:3:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | mod test {} | ----------- expected a non-associated function, found a module | @@ -15,7 +15,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:6:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | / mod loooooooooooooong_teeeeeeeeeest { LL | | /* LL | | this is a comment @@ -34,7 +34,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:20:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | extern "C" {} | ------------- expected a non-associated function, found an extern block | @@ -47,7 +47,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:23:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | trait Foo {} | ------------ expected a non-associated function, found a trait | @@ -60,7 +60,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:26:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | impl Foo for i32 {} | ------------------- expected a non-associated function, found an implementation | @@ -73,7 +73,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:29:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | const FOO: i32 = -1_i32; | ------------------------ expected a non-associated function, found a constant item | @@ -86,7 +86,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:32:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | static BAR: u64 = 10_000_u64; | ----------------------------- expected a non-associated function, found a static item | @@ -99,7 +99,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:35:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | / enum MyUnit { LL | | Unit, LL | | } @@ -114,7 +114,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:40:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | struct NewI32(i32); | ------------------- expected a non-associated function, found a struct | @@ -127,7 +127,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:43:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | / union Spooky { LL | | x: i32, LL | | y: u32, @@ -143,7 +143,7 @@ error: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:50:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | #[derive(Copy, Clone, Debug)] LL | / struct MoreAttrs { LL | | a: i32, @@ -160,7 +160,7 @@ warning: the `#[test]` attribute may only be used on a non-associated function --> $DIR/test-on-not-fn.rs:61:1 | LL | #[test] - | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions + | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions LL | foo!(); | ------- expected a non-associated function, found an item macro invocation | diff --git a/src/test/ui/transmutability/issue-101739-1.rs b/src/test/ui/transmutability/issue-101739-1.rs new file mode 100644 index 00000000000..bcb8b158edf --- /dev/null +++ b/src/test/ui/transmutability/issue-101739-1.rs @@ -0,0 +1,21 @@ +#![feature(transmutability)] + +mod assert { + use std::mem::BikeshedIntrinsicFrom; + + pub fn is_transmutable<Src, Context, const ASSUME_ALIGNMENT: bool>() + where + Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, //~ ERROR cannot find type `Dst` in this scope + //~^ ERROR mismatched types + { + } +} + +fn via_const() { + struct Context; + struct Src; + + assert::is_transmutable::<Src, Context, false>(); +} + +fn main() {} diff --git a/src/test/ui/transmutability/issue-101739-1.stderr b/src/test/ui/transmutability/issue-101739-1.stderr new file mode 100644 index 00000000000..5fa741f26fd --- /dev/null +++ b/src/test/ui/transmutability/issue-101739-1.stderr @@ -0,0 +1,16 @@ +error[E0412]: cannot find type `Dst` in this scope + --> $DIR/issue-101739-1.rs:8:9 + | +LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, + | ^^^ not found in this scope + +error[E0308]: mismatched types + --> $DIR/issue-101739-1.rs:8:50 + | +LL | Dst: BikeshedIntrinsicFrom<Src, Context, ASSUME_ALIGNMENT>, + | ^^^^^^^^^^^^^^^^ expected struct `Assume`, found `bool` + +error: aborting due to 2 previous errors + +Some errors have detailed explanations: E0308, E0412. +For more information about an error, try `rustc --explain E0308`. diff --git a/src/test/ui/transmutability/issue-101739-2.rs b/src/test/ui/transmutability/issue-101739-2.rs new file mode 100644 index 00000000000..964a7e49ee6 --- /dev/null +++ b/src/test/ui/transmutability/issue-101739-2.rs @@ -0,0 +1,37 @@ +#![crate_type = "lib"] +#![feature(transmutability)] +#![allow(dead_code, incomplete_features, non_camel_case_types)] + +mod assert { + use std::mem::BikeshedIntrinsicFrom; + + pub fn is_transmutable< + Src, + Dst, + Context, + const ASSUME_ALIGNMENT: bool, + const ASSUME_LIFETIMES: bool, + const ASSUME_VALIDITY: bool, + const ASSUME_VISIBILITY: bool, + >() + where + Dst: BikeshedIntrinsicFrom< //~ ERROR this trait takes at most 3 generic arguments but 6 generic arguments were supplied + Src, + Context, + ASSUME_ALIGNMENT, + ASSUME_LIFETIMES, + ASSUME_VALIDITY, + ASSUME_VISIBILITY, + >, + {} +} + +fn via_const() { + struct Context; + #[repr(C)] struct Src; + #[repr(C)] struct Dst; + + const FALSE: bool = false; + + assert::is_transmutable::<Src, Dst, Context, FALSE, FALSE, FALSE, FALSE>(); +} diff --git a/src/test/ui/transmutability/issue-101739-2.stderr b/src/test/ui/transmutability/issue-101739-2.stderr new file mode 100644 index 00000000000..3f83d6583b0 --- /dev/null +++ b/src/test/ui/transmutability/issue-101739-2.stderr @@ -0,0 +1,20 @@ +error[E0107]: this trait takes at most 3 generic arguments but 6 generic arguments were supplied + --> $DIR/issue-101739-2.rs:18:14 + | +LL | Dst: BikeshedIntrinsicFrom< + | ^^^^^^^^^^^^^^^^^^^^^ expected at most 3 generic arguments +... +LL | / ASSUME_LIFETIMES, +LL | | ASSUME_VALIDITY, +LL | | ASSUME_VISIBILITY, + | |_____________________________- help: remove these generic arguments + | +note: trait defined here, with at most 3 generic parameters: `Src`, `Context`, `ASSUME` + --> $SRC_DIR/core/src/mem/transmutability.rs:LL:COL + | +LL | pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }> + | ^^^^^^^^^^^^^^^^^^^^^ --- ------- ------------------------------------------ + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0107`. |
