diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:31 +0000 |
commit | dc0db358abe19481e475e10c32149b53370f1a1c (patch) | |
tree | ab8ce99c4b255ce46f99ef402c27916055b899ee /tests/ui/proc-macro/auxiliary | |
parent | Releasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff) | |
download | rustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/proc-macro/auxiliary')
-rw-r--r-- | tests/ui/proc-macro/auxiliary/api/cmp.rs | 11 | ||||
-rw-r--r-- | tests/ui/proc-macro/auxiliary/assert-span-pos.rs | 5 | ||||
-rw-r--r-- | tests/ui/proc-macro/auxiliary/exports_no_mangle.rs | 11 | ||||
-rw-r--r-- | tests/ui/proc-macro/auxiliary/macro-only-syntax.rs | 2 |
4 files changed, 15 insertions, 14 deletions
diff --git a/tests/ui/proc-macro/auxiliary/api/cmp.rs b/tests/ui/proc-macro/auxiliary/api/cmp.rs index 5784a6e5d..ec3e637ac 100644 --- a/tests/ui/proc-macro/auxiliary/api/cmp.rs +++ b/tests/ui/proc-macro/auxiliary/api/cmp.rs @@ -1,18 +1,9 @@ -use proc_macro::{LineColumn, Punct, Spacing}; +use proc_macro::{Punct, Spacing}; pub fn test() { - test_line_column_ord(); test_punct_eq(); } -fn test_line_column_ord() { - let line0_column0 = LineColumn { line: 0, column: 0 }; - let line0_column1 = LineColumn { line: 0, column: 1 }; - let line1_column0 = LineColumn { line: 1, column: 0 }; - assert!(line0_column0 < line0_column1); - assert!(line0_column1 < line1_column0); -} - fn test_punct_eq() { let colon_alone = Punct::new(':', Spacing::Alone); assert_eq!(colon_alone, ':'); diff --git a/tests/ui/proc-macro/auxiliary/assert-span-pos.rs b/tests/ui/proc-macro/auxiliary/assert-span-pos.rs index 455c5c7c3..8126470ec 100644 --- a/tests/ui/proc-macro/auxiliary/assert-span-pos.rs +++ b/tests/ui/proc-macro/auxiliary/assert-span-pos.rs @@ -26,10 +26,9 @@ pub fn assert_span_pos(input: TokenStream) -> TokenStream { let line: usize = str1.parse().unwrap(); let col: usize = str2.parse().unwrap(); - let sp1s = sp1.start(); - if (line, col) != (sp1s.line, sp1s.column) { + if (line, col) != (sp1.line(), sp1.column()) { let msg = format!("line/column mismatch: ({}, {}) != ({}, {})", line, col, - sp1s.line, sp1s.column); + sp1.line(), sp1.column()); sp1.error(msg).emit(); } diff --git a/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs b/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs new file mode 100644 index 000000000..a8a478ffc --- /dev/null +++ b/tests/ui/proc-macro/auxiliary/exports_no_mangle.rs @@ -0,0 +1,11 @@ +// force-host +// no-prefer-dynamic +#![crate_type="lib"] + +// Issue 111888: this crate (1.) is imported by a proc-macro crate and (2.) +// exports a no_mangle function; that combination of acts was broken for some +// period of time. See further discussion in the test file that imports this +// crate. + +#[no_mangle] +pub fn some_no_mangle_function() { } diff --git a/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs b/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs index c72306c3d..4ca3a0faa 100644 --- a/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs +++ b/tests/ui/proc-macro/auxiliary/macro-only-syntax.rs @@ -81,7 +81,7 @@ fn expect_brace(tokens: &mut token_stream::IntoIter) -> token_stream::IntoIter { fn check_useful_span(token: TokenTree, expected_filename: &str) { let span = token.span(); - assert!(span.start().column < span.end().column); + assert!(span.column() < span.end().column()); let source_path = span.source_file().path(); let filename = source_path.components().last().unwrap(); |