diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-05-05 21:31:25 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2021-07-08 16:16:28 +0200 |
| commit | a2654fb64c9c9d368063b488693d8da17bc9b4e9 (patch) | |
| tree | e6337d870d12feb89266d5dc2a77214458af7440 /compiler/rustc_ast | |
| parent | 0cd0709f19d316c4796fa71c5f52c8612a5f3771 (diff) | |
| download | rust-a2654fb64c9c9d368063b488693d8da17bc9b4e9.tar.gz rust-a2654fb64c9c9d368063b488693d8da17bc9b4e9.zip | |
Rework SESSION_GLOBALS API to prevent overwriting it
Diffstat (limited to 'compiler/rustc_ast')
| -rw-r--r-- | compiler/rustc_ast/src/util/comments/tests.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_ast/src/util/comments/tests.rs b/compiler/rustc_ast/src/util/comments/tests.rs index 98ab653e45f..6d137f3774f 100644 --- a/compiler/rustc_ast/src/util/comments/tests.rs +++ b/compiler/rustc_ast/src/util/comments/tests.rs @@ -1,9 +1,9 @@ use super::*; -use rustc_span::with_default_session_globals; +use rustc_span::create_default_session_globals_then; #[test] fn test_block_doc_comment_1() { - with_default_session_globals(|| { + create_default_session_globals_then(|| { let comment = "\n * Test \n ** Test\n * Test\n"; let stripped = beautify_doc_string(Symbol::intern(comment)); assert_eq!(stripped.as_str(), " Test \n* Test\n Test"); @@ -12,7 +12,7 @@ fn test_block_doc_comment_1() { #[test] fn test_block_doc_comment_2() { - with_default_session_globals(|| { + create_default_session_globals_then(|| { let comment = "\n * Test\n * Test\n"; let stripped = beautify_doc_string(Symbol::intern(comment)); assert_eq!(stripped.as_str(), " Test\n Test"); @@ -21,7 +21,7 @@ fn test_block_doc_comment_2() { #[test] fn test_block_doc_comment_3() { - with_default_session_globals(|| { + create_default_session_globals_then(|| { let comment = "\n let a: *i32;\n *a = 5;\n"; let stripped = beautify_doc_string(Symbol::intern(comment)); assert_eq!(stripped.as_str(), " let a: *i32;\n *a = 5;"); @@ -30,7 +30,7 @@ fn test_block_doc_comment_3() { #[test] fn test_line_doc_comment() { - with_default_session_globals(|| { + create_default_session_globals_then(|| { let stripped = beautify_doc_string(Symbol::intern(" test")); assert_eq!(stripped.as_str(), " test"); let stripped = beautify_doc_string(Symbol::intern("! test")); |
