From 79956b96e875e6ba2bfa551fabda6b7896f988ac Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 23 Sep 2019 00:49:29 +0200 Subject: [PATCH 01/24] add sub settings in rustdoc --- src/librustdoc/html/render.rs | 99 ++++++++++++++++----- src/librustdoc/html/static/main.js | 32 ++++++- src/librustdoc/html/static/settings.css | 14 +++ src/librustdoc/html/static/themes/dark.css | 3 + src/librustdoc/html/static/themes/light.css | 3 + 5 files changed, 127 insertions(+), 24 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 414c3137376a9..0ad4e2d6ccd9e 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1230,18 +1230,87 @@ impl AllTypes { } } +#[derive(Debug)] +enum Setting { + Section { + description: &'static str, + sub_settings: Vec, + }, + Entry { + js_data_name: &'static str, + description: &'static str, + default_value: bool, + } +} + +impl Setting { + fn display(&self) -> String { + match *self { + Setting::Section { ref description, ref sub_settings } => { + format!( + "
\ +
{}
\ +
{}
+
", + description, + sub_settings.iter().map(|s| s.display()).collect::() + ) + } + Setting::Entry { ref js_data_name, ref description, ref default_value } => { + format!( + "
\ + \ +
{}
\ +
", + js_data_name, + if *default_value { " checked" } else { "" }, + description, + ) + } + } + } +} + +impl From<(&'static str, &'static str, bool)> for Setting { + fn from(values: (&'static str, &'static str, bool)) -> Setting { + Setting::Entry { + js_data_name: values.0, + description: values.1, + default_value: values.2, + } + } +} + +impl> From<(&'static str, Vec)> for Setting { + fn from(values: (&'static str, Vec)) -> Setting { + Setting::Section { + description: values.0, + sub_settings: values.1.into_iter().map(|v| v.into()).collect::>(), + } + } +} + fn settings(root_path: &str, suffix: &str) -> String { // (id, explanation, default value) - let settings = [ - ("item-declarations", "Auto-hide item declarations.", true), - ("item-attributes", "Auto-hide item attributes.", true), - ("trait-implementations", "Auto-hide trait implementations documentation", - true), - ("method-docs", "Auto-hide item methods' documentation", false), + let settings: &[Setting] = &[ + ("Auto-hide item declarations", vec![ + ("auto-hide-struct", "Auto-hide structs declaration", true), + ("auto-hide-enum", "Auto-hide enums declaration", false), + ("auto-hide-union", "Auto-hide unions declaration", true), + ("auto-hide-trait", "Auto-hide traits declaration", true), + ("auto-hide-macro", "Auto-hide macros declaration", false), + ]).into(), + ("auto-hide-attributes", "Auto-hide item attributes.", true).into(), + ("auto-hide-method-docs", "Auto-hide item methods' documentation", false).into(), + ("auto-hide-trait-implementations", "Auto-hide trait implementations documentation", + true).into(), ("go-to-only-result", "Directly go to item in search if there is only one result", - false), - ("line-numbers", "Show line numbers on code examples", false), - ("disable-shortcuts", "Disable keyboard shortcuts", false), + false).into(), + ("line-numbers", "Show line numbers on code examples", false).into(), + ("disable-shortcuts", "Disable keyboard shortcuts", false).into(), ]; format!( "

\ @@ -1249,17 +1318,7 @@ fn settings(root_path: &str, suffix: &str) -> String {

\
{}
\ ", - settings.iter() - .map(|(id, text, enabled)| { - format!("
\ - \ -
{}
\ -
", id, if *enabled { " checked" } else { "" }, text) - }) - .collect::(), + settings.iter().map(|s| s.display()).collect::(), root_path, suffix) } diff --git a/src/librustdoc/html/static/main.js b/src/librustdoc/html/static/main.js index a0e07d58c9da9..65410a99e181e 100644 --- a/src/librustdoc/html/static/main.js +++ b/src/librustdoc/html/static/main.js @@ -2102,7 +2102,7 @@ function getSearchElement() { function autoCollapse(pageId, collapse) { if (collapse) { toggleAllDocs(pageId, true); - } else if (getCurrentValue("rustdoc-trait-implementations") !== "false") { + } else if (getCurrentValue("rustdoc-auto-hide-trait-implementations") !== "false") { var impl_list = document.getElementById("implementations-list"); if (impl_list !== null) { @@ -2140,7 +2140,7 @@ function getSearchElement() { } var toggle = createSimpleToggle(false); - var hideMethodDocs = getCurrentValue("rustdoc-method-docs") === "true"; + var hideMethodDocs = getCurrentValue("rustdoc-auto-hide-method-docs") === "true"; var pageId = getPageId(); var func = function(e) { @@ -2270,7 +2270,31 @@ function getSearchElement() { return wrapper; } - var showItemDeclarations = getCurrentValue("rustdoc-item-declarations") === "false"; + var currentType = document.getElementsByClassName("type-decl")[0]; + var className = null; + if (currentType) { + currentType = currentType.getElementsByClassName("rust")[0]; + if (currentType) { + currentType.classList.forEach(function(item) { + if (item !== "main") { + className = item; + return true; + } + }); + } + } + var showItemDeclarations = getCurrentValue("rustdoc-auto-hide-" + className); + if (showItemDeclarations === null) { + if (className === "enum" || className === "macro") { + showItemDeclarations = "false"; + } else if (className === "struct" || className === "union" || className === "trait") { + showItemDeclarations = "true"; + } else { + // In case we found an unknown type, we just use the "parent" value. + showItemDeclarations = getCurrentValue("rustdoc-auto-hide-declarations"); + } + } + showItemDeclarations = showItemDeclarations === "false"; function buildToggleWrapper(e) { if (hasClass(e, "autohide")) { var wrap = e.previousElementSibling; @@ -2353,7 +2377,7 @@ function getSearchElement() { // To avoid checking on "rustdoc-item-attributes" value on every loop... var itemAttributesFunc = function() {}; - if (getCurrentValue("rustdoc-item-attributes") !== "false") { + if (getCurrentValue("rustdoc-auto-hide-attributes") !== "false") { itemAttributesFunc = function(x) { collapseDocs(x.previousSibling.childNodes[0], "toggle"); }; diff --git a/src/librustdoc/html/static/settings.css b/src/librustdoc/html/static/settings.css index b31ad96fa545f..c66c5d3636052 100644 --- a/src/librustdoc/html/static/settings.css +++ b/src/librustdoc/html/static/settings.css @@ -1,5 +1,6 @@ .setting-line { padding: 5px; + position: relative; } .setting-line > div { @@ -10,6 +11,13 @@ padding-top: 2px; } +.setting-line > .title { + font-size: 19px; + width: 100%; + max-width: none; + border-bottom: 1px solid; +} + .toggle { position: relative; display: inline-block; @@ -59,3 +67,9 @@ input:checked + .slider:before { -ms-transform: translateX(19px); transform: translateX(19px); } + +.setting-line > .sub-setting { + padding-left: 42px; + width: 100%; + display: block; +} diff --git a/src/librustdoc/html/static/themes/dark.css b/src/librustdoc/html/static/themes/dark.css index c3116dbe7a242..a60d543a53936 100644 --- a/src/librustdoc/html/static/themes/dark.css +++ b/src/librustdoc/html/static/themes/dark.css @@ -425,3 +425,6 @@ div.files > a:hover, div.name:hover { div.files > .selected { background-color: #333; } +.setting-line > .title { + border-bottom-color: #ddd; +} diff --git a/src/librustdoc/html/static/themes/light.css b/src/librustdoc/html/static/themes/light.css index e2bf9f9d2f23a..351f027b942ff 100644 --- a/src/librustdoc/html/static/themes/light.css +++ b/src/librustdoc/html/static/themes/light.css @@ -419,3 +419,6 @@ div.files > a:hover, div.name:hover { div.files > .selected { background-color: #fff; } +.setting-line > .title { + border-bottom-color: #D5D5D5; +} From 8784b074e7ad741e1feed203b55ad9a204ad8cd3 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 4 Nov 2019 11:39:00 +0100 Subject: [PATCH 02/24] Change sub-setting CSS class to sub-settings --- src/librustdoc/html/render.rs | 2 +- src/librustdoc/html/static/settings.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 0ad4e2d6ccd9e..f521c057afe37 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1250,7 +1250,7 @@ impl Setting { format!( "
\
{}
\ -
{}
+
{}
", description, sub_settings.iter().map(|s| s.display()).collect::() diff --git a/src/librustdoc/html/static/settings.css b/src/librustdoc/html/static/settings.css index c66c5d3636052..d03cf7fcc459e 100644 --- a/src/librustdoc/html/static/settings.css +++ b/src/librustdoc/html/static/settings.css @@ -68,7 +68,7 @@ input:checked + .slider:before { transform: translateX(19px); } -.setting-line > .sub-setting { +.setting-line > .sub-settings { padding-left: 42px; width: 100%; display: block; From a99fba5bc5324aad2785ffd249a999aac3a4cde7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Tue, 29 Oct 2019 00:00:00 +0000 Subject: [PATCH 03/24] Remove no longer useful ui test --- src/test/ui/issues/issue-15108.rs | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 src/test/ui/issues/issue-15108.rs diff --git a/src/test/ui/issues/issue-15108.rs b/src/test/ui/issues/issue-15108.rs deleted file mode 100644 index b8231ad4e8326..0000000000000 --- a/src/test/ui/issues/issue-15108.rs +++ /dev/null @@ -1,4 +0,0 @@ -// build-pass (FIXME(62277): could be check-pass?) -// pretty-expanded FIXME #23616 - -fn main() {} From a03474bc54b801ded60fd49f01f2e1b4b6918512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Tue, 29 Oct 2019 00:00:00 +0000 Subject: [PATCH 04/24] Use run-pass for ui tests where appropriate --- src/test/ui/issues/issue-20091.rs | 2 +- src/test/ui/issues/issue-21634.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/issues/issue-20091.rs b/src/test/ui/issues/issue-20091.rs index 68e0f65ca2382..90db44fa02d42 100644 --- a/src/test/ui/issues/issue-20091.rs +++ b/src/test/ui/issues/issue-20091.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// run-pass #![allow(stable_features)] // ignore-cloudabi no processes diff --git a/src/test/ui/issues/issue-21634.rs b/src/test/ui/issues/issue-21634.rs index 36b207bb2a481..2731bfd767f3e 100644 --- a/src/test/ui/issues/issue-21634.rs +++ b/src/test/ui/issues/issue-21634.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// run-pass #![allow(stable_features)] #![feature(cfg_target_feature)] From 045fdd9fa92e745ff0694de4b4c6aab782212286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Tue, 29 Oct 2019 00:00:00 +0000 Subject: [PATCH 05/24] Use build-pass in ui tests where appropriate --- src/test/ui/async-await/issue-61793.rs | 2 +- src/test/ui/issues/issue-10763.rs | 2 +- src/test/ui/issues/issue-1251.rs | 2 +- src/test/ui/issues/issue-13214.rs | 2 +- src/test/ui/issues/issue-14330.rs | 2 +- src/test/ui/issues/issue-14936.rs | 2 +- src/test/ui/issues/issue-15261.rs | 2 +- src/test/ui/issues/issue-17336.rs | 2 +- src/test/ui/issues/issue-17450.rs | 2 +- src/test/ui/issues/issue-17718-const-destructors.rs | 2 +- src/test/ui/issues/issue-1866.rs | 2 +- src/test/ui/issues/issue-19404.rs | 2 +- src/test/ui/issues/issue-20644.rs | 2 +- src/test/ui/issues/issue-20797.rs | 2 +- src/test/ui/issues/issue-21562.rs | 2 +- src/test/ui/issues/issue-21891.rs | 2 +- src/test/ui/issues/issue-22894.rs | 2 +- src/test/ui/issues/issue-23406.rs | 2 +- src/test/ui/issues/issue-23550.rs | 2 +- src/test/ui/issues/issue-23649-3.rs | 2 +- src/test/ui/issues/issue-2487-a.rs | 2 +- src/test/ui/issues/issue-26997.rs | 2 +- src/test/ui/issues/issue-2748-a.rs | 2 +- src/test/ui/issues/issue-28600.rs | 2 +- src/test/ui/issues/issue-2904.rs | 2 +- src/test/ui/issues/issue-33264.rs | 2 +- src/test/ui/issues/issue-33287.rs | 2 +- src/test/ui/issues/issue-34194.rs | 2 +- src/test/ui/issues/issue-35546.rs | 2 +- src/test/ui/issues/issue-3563-2.rs | 2 +- src/test/ui/issues/issue-36744-without-calls.rs | 2 +- src/test/ui/issues/issue-37733.rs | 2 +- src/test/ui/issues/issue-38727.rs | 2 +- src/test/ui/issues/issue-3874.rs | 2 +- src/test/ui/issues/issue-3991.rs | 2 +- src/test/ui/issues/issue-44005.rs | 2 +- src/test/ui/issues/issue-44056.rs | 2 +- src/test/ui/issues/issue-47309.rs | 2 +- src/test/ui/issues/issue-50411.rs | 2 +- src/test/ui/issues/issue-50761.rs | 2 +- src/test/ui/issues/issue-50993.rs | 2 +- src/test/ui/issues/issue-51947.rs | 2 +- src/test/ui/issues/issue-53912.rs | 2 +- src/test/ui/issues/issue-56202.rs | 2 +- src/test/ui/issues/issue-5754.rs | 2 +- src/test/ui/issues/issue-5884.rs | 2 +- src/test/ui/issues/issue-6470.rs | 2 +- src/test/ui/issues/issue-9243.rs | 2 +- src/test/ui/issues/issue-9719.rs | 2 +- src/test/ui/privacy/issue-57264-1.rs | 2 +- src/test/ui/privacy/issue-57264-2.rs | 2 +- src/test/ui/suggestions/issue-57672.rs | 2 +- 52 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/test/ui/async-await/issue-61793.rs b/src/test/ui/async-await/issue-61793.rs index f6084be916745..9180e1d811aa3 100644 --- a/src/test/ui/async-await/issue-61793.rs +++ b/src/test/ui/async-await/issue-61793.rs @@ -3,7 +3,7 @@ // while those two fields were at the same offset (which is impossible). // That is, memory ordering of `(X, ())`, but offsets of `((), X)`. -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // edition:2018 async fn foo(_: &(), _: F) {} diff --git a/src/test/ui/issues/issue-10763.rs b/src/test/ui/issues/issue-10763.rs index 091a7c5296342..627a8c2384ca9 100644 --- a/src/test/ui/issues/issue-10763.rs +++ b/src/test/ui/issues/issue-10763.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-1251.rs b/src/test/ui/issues/issue-1251.rs index 77278ecda6ecb..7f25c9a787ed9 100644 --- a/src/test/ui/issues/issue-1251.rs +++ b/src/test/ui/issues/issue-1251.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(unused_attributes)] #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-13214.rs b/src/test/ui/issues/issue-13214.rs index 0015169b11798..0cf8d0675e6ab 100644 --- a/src/test/ui/issues/issue-13214.rs +++ b/src/test/ui/issues/issue-13214.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // defining static with struct that contains enum // with &'static str variant used to cause ICE diff --git a/src/test/ui/issues/issue-14330.rs b/src/test/ui/issues/issue-14330.rs index be31fa5eabc59..2b0be5edef4c9 100644 --- a/src/test/ui/issues/issue-14330.rs +++ b/src/test/ui/issues/issue-14330.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(unused_imports)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-14936.rs b/src/test/ui/issues/issue-14936.rs index 809a1088992a0..33532855fcd7e 100644 --- a/src/test/ui/issues/issue-14936.rs +++ b/src/test/ui/issues/issue-14936.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(unused_macros)] #![allow(dead_code)] #![feature(asm)] diff --git a/src/test/ui/issues/issue-15261.rs b/src/test/ui/issues/issue-15261.rs index dd859475f9c8e..ec413f6d1d2be 100644 --- a/src/test/ui/issues/issue-15261.rs +++ b/src/test/ui/issues/issue-15261.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-17336.rs b/src/test/ui/issues/issue-17336.rs index 830d799fb652f..89ce59b11f259 100644 --- a/src/test/ui/issues/issue-17336.rs +++ b/src/test/ui/issues/issue-17336.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(unused_must_use)] #[allow(dead_code)] fn check(a: &str) { diff --git a/src/test/ui/issues/issue-17450.rs b/src/test/ui/issues/issue-17450.rs index 595e0a4d25c65..1ac0af1754ba4 100644 --- a/src/test/ui/issues/issue-17450.rs +++ b/src/test/ui/issues/issue-17450.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code, warnings)] static mut x: isize = 3; diff --git a/src/test/ui/issues/issue-17718-const-destructors.rs b/src/test/ui/issues/issue-17718-const-destructors.rs index 7ec025ec3af75..2e2fdab12cd41 100644 --- a/src/test/ui/issues/issue-17718-const-destructors.rs +++ b/src/test/ui/issues/issue-17718-const-destructors.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] struct A; impl Drop for A { diff --git a/src/test/ui/issues/issue-1866.rs b/src/test/ui/issues/issue-1866.rs index 0223e2ebea926..e4fe26800eff3 100644 --- a/src/test/ui/issues/issue-1866.rs +++ b/src/test/ui/issues/issue-1866.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/issues/issue-19404.rs b/src/test/ui/issues/issue-19404.rs index 40c9fdac7b01f..f1cf1feb00542 100644 --- a/src/test/ui/issues/issue-19404.rs +++ b/src/test/ui/issues/issue-19404.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(unused_variables)] use std::any::TypeId; diff --git a/src/test/ui/issues/issue-20644.rs b/src/test/ui/issues/issue-20644.rs index bde65229ec286..36eac38249664 100644 --- a/src/test/ui/issues/issue-20644.rs +++ b/src/test/ui/issues/issue-20644.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(unused_imports)] #![allow(stable_features)] diff --git a/src/test/ui/issues/issue-20797.rs b/src/test/ui/issues/issue-20797.rs index bda7e8f818b15..5d82592e5ea57 100644 --- a/src/test/ui/issues/issue-20797.rs +++ b/src/test/ui/issues/issue-20797.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // ignore-cloudabi no std::fs // Regression test for #20797. diff --git a/src/test/ui/issues/issue-21562.rs b/src/test/ui/issues/issue-21562.rs index 2f3ee7b749091..a47d739c6be94 100644 --- a/src/test/ui/issues/issue-21562.rs +++ b/src/test/ui/issues/issue-21562.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-21891.rs b/src/test/ui/issues/issue-21891.rs index de0aa2919cfbc..576f0253e63e0 100644 --- a/src/test/ui/issues/issue-21891.rs +++ b/src/test/ui/issues/issue-21891.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-22894.rs b/src/test/ui/issues/issue-22894.rs index 7b1513a10c0ef..93c1db914ea44 100644 --- a/src/test/ui/issues/issue-22894.rs +++ b/src/test/ui/issues/issue-22894.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #[allow(dead_code)] static X: &'static str = &*""; fn main() {} diff --git a/src/test/ui/issues/issue-23406.rs b/src/test/ui/issues/issue-23406.rs index 2e57b16e3c7f0..d00d5d6f944e6 100644 --- a/src/test/ui/issues/issue-23406.rs +++ b/src/test/ui/issues/issue-23406.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] trait Inner { type T; diff --git a/src/test/ui/issues/issue-23550.rs b/src/test/ui/issues/issue-23550.rs index fad0ad7eccaa4..9cce9a0a98b63 100644 --- a/src/test/ui/issues/issue-23550.rs +++ b/src/test/ui/issues/issue-23550.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![feature(core_intrinsics)] #![allow(warnings)] diff --git a/src/test/ui/issues/issue-23649-3.rs b/src/test/ui/issues/issue-23649-3.rs index febdc4256c757..8f61c71d6eb7c 100644 --- a/src/test/ui/issues/issue-23649-3.rs +++ b/src/test/ui/issues/issue-23649-3.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #[derive(PartialEq)] struct Slice { slice: [u8] } diff --git a/src/test/ui/issues/issue-2487-a.rs b/src/test/ui/issues/issue-2487-a.rs index a43933d20202d..fe12dad74f53f 100644 --- a/src/test/ui/issues/issue-2487-a.rs +++ b/src/test/ui/issues/issue-2487-a.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/issues/issue-26997.rs b/src/test/ui/issues/issue-26997.rs index a2b32a13678a5..f6d349a38f523 100644 --- a/src/test/ui/issues/issue-26997.rs +++ b/src/test/ui/issues/issue-26997.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] pub struct Foo { x: isize, diff --git a/src/test/ui/issues/issue-2748-a.rs b/src/test/ui/issues/issue-2748-a.rs index 5f566e186eb20..cbb9bcc28ac8b 100644 --- a/src/test/ui/issues/issue-2748-a.rs +++ b/src/test/ui/issues/issue-2748-a.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(non_snake_case)] diff --git a/src/test/ui/issues/issue-28600.rs b/src/test/ui/issues/issue-28600.rs index 05c4050b03a43..3bbe4ae29bdd6 100644 --- a/src/test/ui/issues/issue-28600.rs +++ b/src/test/ui/issues/issue-28600.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // #28600 ICE: pub extern fn with parameter type &str inside struct impl struct Test; diff --git a/src/test/ui/issues/issue-2904.rs b/src/test/ui/issues/issue-2904.rs index 36bc8002f99db..73aa78f09b9ea 100644 --- a/src/test/ui/issues/issue-2904.rs +++ b/src/test/ui/issues/issue-2904.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(unused_must_use)] #![allow(dead_code)] #![allow(unused_mut)] diff --git a/src/test/ui/issues/issue-33264.rs b/src/test/ui/issues/issue-33264.rs index e6370bc84deaf..31638b004391f 100644 --- a/src/test/ui/issues/issue-33264.rs +++ b/src/test/ui/issues/issue-33264.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // only-x86_64 #![allow(dead_code, non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-33287.rs b/src/test/ui/issues/issue-33287.rs index 036a1e3768843..770eb7c02bbae 100644 --- a/src/test/ui/issues/issue-33287.rs +++ b/src/test/ui/issues/issue-33287.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(unused_variables)] const A: [u32; 1] = [0]; diff --git a/src/test/ui/issues/issue-34194.rs b/src/test/ui/issues/issue-34194.rs index ea89e4cbdeb88..6dce556e9e384 100644 --- a/src/test/ui/issues/issue-34194.rs +++ b/src/test/ui/issues/issue-34194.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] struct A { diff --git a/src/test/ui/issues/issue-35546.rs b/src/test/ui/issues/issue-35546.rs index e2f0f98d57b4f..004679a6240b1 100644 --- a/src/test/ui/issues/issue-35546.rs +++ b/src/test/ui/issues/issue-35546.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // Regression test for #35546. Check that we are able to codegen // this. Before we had problems because of the drop glue signature diff --git a/src/test/ui/issues/issue-3563-2.rs b/src/test/ui/issues/issue-3563-2.rs index 5ab668eed1899..58fb839a71198 100644 --- a/src/test/ui/issues/issue-3563-2.rs +++ b/src/test/ui/issues/issue-3563-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // pretty-expanded FIXME #23616 trait Canvas { diff --git a/src/test/ui/issues/issue-36744-without-calls.rs b/src/test/ui/issues/issue-36744-without-calls.rs index 4d03d9bbca6b6..dc5dc4f13c0b8 100644 --- a/src/test/ui/issues/issue-36744-without-calls.rs +++ b/src/test/ui/issues/issue-36744-without-calls.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // Tests for an LLVM abort when storing a lifetime-parametric fn into // context that is expecting one that is not lifetime-parametric // (i.e., has no `for <'_>`). diff --git a/src/test/ui/issues/issue-37733.rs b/src/test/ui/issues/issue-37733.rs index c1df28331a548..e211e2c3336e5 100644 --- a/src/test/ui/issues/issue-37733.rs +++ b/src/test/ui/issues/issue-37733.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] type A = for<> fn(); diff --git a/src/test/ui/issues/issue-38727.rs b/src/test/ui/issues/issue-38727.rs index 3c728e9def1e9..2d418b652699e 100644 --- a/src/test/ui/issues/issue-38727.rs +++ b/src/test/ui/issues/issue-38727.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #[repr(u64)] enum A { diff --git a/src/test/ui/issues/issue-3874.rs b/src/test/ui/issues/issue-3874.rs index b290da5208042..f9553d88d2410 100644 --- a/src/test/ui/issues/issue-3874.rs +++ b/src/test/ui/issues/issue-3874.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-3991.rs b/src/test/ui/issues/issue-3991.rs index b8ff671bf38ae..535b5675d6540 100644 --- a/src/test/ui/issues/issue-3991.rs +++ b/src/test/ui/issues/issue-3991.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-44005.rs b/src/test/ui/issues/issue-44005.rs index f6fe9fcbd89a3..041fcdbf823bf 100644 --- a/src/test/ui/issues/issue-44005.rs +++ b/src/test/ui/issues/issue-44005.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass pub trait Foo<'a> { type Bar; fn foo(&'a self) -> Self::Bar; diff --git a/src/test/ui/issues/issue-44056.rs b/src/test/ui/issues/issue-44056.rs index 42f30bf30239a..a4903ed2cb427 100644 --- a/src/test/ui/issues/issue-44056.rs +++ b/src/test/ui/issues/issue-44056.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass (FIXME(55996): should be run on targets supporting avx) // only-x86_64 // no-prefer-dynamic // compile-flags: -Ctarget-feature=+avx -Clto diff --git a/src/test/ui/issues/issue-47309.rs b/src/test/ui/issues/issue-47309.rs index 03092022d4d55..abed9687b4993 100644 --- a/src/test/ui/issues/issue-47309.rs +++ b/src/test/ui/issues/issue-47309.rs @@ -3,7 +3,7 @@ // See https://github.com/rust-lang/rust/issues/47309 // compile-flags:-Clink-dead-code -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![crate_type="rlib"] diff --git a/src/test/ui/issues/issue-50411.rs b/src/test/ui/issues/issue-50411.rs index a32faa69841fd..1bf1270781747 100644 --- a/src/test/ui/issues/issue-50411.rs +++ b/src/test/ui/issues/issue-50411.rs @@ -4,7 +4,7 @@ // second time. Uncool. // compile-flags:-Zmir-opt-level=3 -// build-pass (FIXME(62277): could be check-pass?) +// build-pass fn main() { let _ = (0 .. 1).filter(|_| [1].iter().all(|_| true)).count(); diff --git a/src/test/ui/issues/issue-50761.rs b/src/test/ui/issues/issue-50761.rs index 59d4f9afdaa01..1bf494ba8f97e 100644 --- a/src/test/ui/issues/issue-50761.rs +++ b/src/test/ui/issues/issue-50761.rs @@ -1,6 +1,6 @@ // Confirm that we don't accidentally divide or mod by zero in llvm_type -// build-pass (FIXME(62277): could be check-pass?) +// build-pass mod a { pub trait A {} diff --git a/src/test/ui/issues/issue-50993.rs b/src/test/ui/issues/issue-50993.rs index b170e09d02d06..d38eb82667812 100644 --- a/src/test/ui/issues/issue-50993.rs +++ b/src/test/ui/issues/issue-50993.rs @@ -1,5 +1,5 @@ // compile-flags: --crate-type dylib --target thumbv7em-none-eabihf -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // error-pattern: dropping unsupported crate type `dylib` for target `thumbv7em-none-eabihf` #![feature(no_core)] diff --git a/src/test/ui/issues/issue-51947.rs b/src/test/ui/issues/issue-51947.rs index b5ebf156a2730..c877fb8aef19b 100644 --- a/src/test/ui/issues/issue-51947.rs +++ b/src/test/ui/issues/issue-51947.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![crate_type = "lib"] #![feature(linkage)] diff --git a/src/test/ui/issues/issue-53912.rs b/src/test/ui/issues/issue-53912.rs index 4718aea0429c2..65b6825a83254 100644 --- a/src/test/ui/issues/issue-53912.rs +++ b/src/test/ui/issues/issue-53912.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // This test is the same code as in ui/symbol-names/issue-60925.rs but this checks that the // reproduction compiles successfully and doesn't segfault, whereas that test just checks that the diff --git a/src/test/ui/issues/issue-56202.rs b/src/test/ui/issues/issue-56202.rs index 6d6f23d2844a6..0952843e60a1a 100644 --- a/src/test/ui/issues/issue-56202.rs +++ b/src/test/ui/issues/issue-56202.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass trait FooTrait {} diff --git a/src/test/ui/issues/issue-5754.rs b/src/test/ui/issues/issue-5754.rs index a629729d39501..d90816635aba4 100644 --- a/src/test/ui/issues/issue-5754.rs +++ b/src/test/ui/issues/issue-5754.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(improper_ctypes)] diff --git a/src/test/ui/issues/issue-5884.rs b/src/test/ui/issues/issue-5884.rs index acb3e19765e66..2f64342a6dd82 100644 --- a/src/test/ui/issues/issue-5884.rs +++ b/src/test/ui/issues/issue-5884.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-6470.rs b/src/test/ui/issues/issue-6470.rs index 305f46c6d4ee9..0c86a648828fa 100644 --- a/src/test/ui/issues/issue-6470.rs +++ b/src/test/ui/issues/issue-6470.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] #![allow(improper_ctypes)] diff --git a/src/test/ui/issues/issue-9243.rs b/src/test/ui/issues/issue-9243.rs index 78237421c982b..59fdb466285b4 100644 --- a/src/test/ui/issues/issue-9243.rs +++ b/src/test/ui/issues/issue-9243.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // Regression test for issue 9243 #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-9719.rs b/src/test/ui/issues/issue-9719.rs index 58eb32b111dd9..e8c3c9c194a38 100644 --- a/src/test/ui/issues/issue-9719.rs +++ b/src/test/ui/issues/issue-9719.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/privacy/issue-57264-1.rs b/src/test/ui/privacy/issue-57264-1.rs index 5ef6a61fea174..5de251148e3c5 100644 --- a/src/test/ui/privacy/issue-57264-1.rs +++ b/src/test/ui/privacy/issue-57264-1.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // aux-build:issue-57264-1.rs extern crate issue_57264_1; diff --git a/src/test/ui/privacy/issue-57264-2.rs b/src/test/ui/privacy/issue-57264-2.rs index 4d5c9cfa1d534..5cbb862fd9c2c 100644 --- a/src/test/ui/privacy/issue-57264-2.rs +++ b/src/test/ui/privacy/issue-57264-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // aux-build:issue-57264-2.rs extern crate issue_57264_2; diff --git a/src/test/ui/suggestions/issue-57672.rs b/src/test/ui/suggestions/issue-57672.rs index 0881a631f3a76..a469247182935 100644 --- a/src/test/ui/suggestions/issue-57672.rs +++ b/src/test/ui/suggestions/issue-57672.rs @@ -1,6 +1,6 @@ // aux-build:foo.rs // compile-flags:--extern foo -// build-pass (FIXME(62277): could be check-pass?) +// build-pass // edition:2018 #![deny(unused_extern_crates)] From 0501d8ab0dfbd5fe817ca62efbbfadd453fa7b68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 4 Nov 2019 00:00:00 +0000 Subject: [PATCH 06/24] Use check-pass in ui tests where appropriate --- src/test/ui/async-await/issues/issue-53249.rs | 2 +- src/test/ui/async-await/issues/issue-54974.rs | 2 +- src/test/ui/async-await/issues/issue-60518.rs | 2 +- .../issue-55552-ascribe-wildcard-to-structured-pattern.rs | 2 +- src/test/ui/closure-expected-type/issue-24421.rs | 2 +- src/test/ui/consts/issue-62045.rs | 2 +- .../ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs | 2 +- src/test/ui/feature-gate/issue-43106-gating-of-macro_escape.rs | 2 +- src/test/ui/generator/issue-53548-1.rs | 2 +- src/test/ui/generator/issue-53548.rs | 2 +- src/test/ui/impl-trait/issues/issue-42479.rs | 2 +- src/test/ui/impl-trait/issues/issue-49376.rs | 2 +- src/test/ui/impl-trait/issues/issue-52128.rs | 2 +- .../ui/impl-trait/issues/issue-55608-captures-empty-region.rs | 2 +- .../ui/impl-trait/issues/issue-57464-unexpected-regions.rs | 2 +- src/test/ui/imports/issue-53140.rs | 2 +- src/test/ui/imports/issue-55811.rs | 2 +- src/test/ui/imports/issue-56263.rs | 2 +- src/test/ui/issues/issue-10396.rs | 2 +- src/test/ui/issues/issue-10456.rs | 2 +- src/test/ui/issues/issue-10853.rs | 2 +- src/test/ui/issues/issue-10902.rs | 2 +- src/test/ui/issues/issue-11384.rs | 2 +- src/test/ui/issues/issue-11592.rs | 2 +- src/test/ui/issues/issue-11612.rs | 2 +- src/test/ui/issues/issue-11869.rs | 2 +- src/test/ui/issues/issue-12729.rs | 2 +- src/test/ui/issues/issue-13105.rs | 2 +- src/test/ui/issues/issue-13167.rs | 2 +- src/test/ui/issues/issue-13405.rs | 2 +- src/test/ui/issues/issue-13703.rs | 2 +- src/test/ui/issues/issue-13775.rs | 2 +- src/test/ui/issues/issue-13837.rs | 2 +- src/test/ui/issues/issue-14082.rs | 2 +- src/test/ui/issues/issue-14254.rs | 2 +- src/test/ui/issues/issue-14837.rs | 2 +- src/test/ui/issues/issue-14901.rs | 2 +- src/test/ui/issues/issue-14933.rs | 2 +- src/test/ui/issues/issue-14959.rs | 2 +- src/test/ui/issues/issue-15689-2.rs | 2 +- src/test/ui/issues/issue-15735.rs | 2 +- src/test/ui/issues/issue-16596.rs | 2 +- src/test/ui/issues/issue-16668.rs | 2 +- src/test/ui/issues/issue-17121.rs | 2 +- src/test/ui/issues/issue-17263.rs | 2 +- src/test/ui/issues/issue-17732.rs | 2 +- src/test/ui/issues/issue-17746.rs | 2 +- src/test/ui/issues/issue-17904.rs | 2 +- src/test/ui/issues/issue-18083.rs | 2 +- src/test/ui/issues/issue-18088.rs | 2 +- src/test/ui/issues/issue-18188.rs | 2 +- src/test/ui/issues/issue-1821.rs | 2 +- src/test/ui/issues/issue-18446-2.rs | 2 +- src/test/ui/issues/issue-18738.rs | 2 +- src/test/ui/issues/issue-18809.rs | 2 +- src/test/ui/issues/issue-18906.rs | 2 +- src/test/ui/issues/issue-18988.rs | 2 +- src/test/ui/issues/issue-19037.rs | 2 +- src/test/ui/issues/issue-19081.rs | 2 +- src/test/ui/issues/issue-19097.rs | 2 +- src/test/ui/issues/issue-19098.rs | 2 +- src/test/ui/issues/issue-19102.rs | 2 +- src/test/ui/issues/issue-19129-1.rs | 2 +- src/test/ui/issues/issue-19129-2.rs | 2 +- src/test/ui/issues/issue-19398.rs | 2 +- src/test/ui/issues/issue-19479.rs | 2 +- src/test/ui/issues/issue-19631.rs | 2 +- src/test/ui/issues/issue-19632.rs | 2 +- src/test/ui/issues/issue-19850.rs | 2 +- src/test/ui/issues/issue-19982.rs | 2 +- src/test/ui/issues/issue-20009.rs | 2 +- src/test/ui/issues/issue-20186.rs | 2 +- src/test/ui/issues/issue-20396.rs | 2 +- src/test/ui/issues/issue-20414.rs | 2 +- src/test/ui/issues/issue-20454.rs | 2 +- src/test/ui/issues/issue-2063-resource.rs | 2 +- src/test/ui/issues/issue-20763-1.rs | 2 +- src/test/ui/issues/issue-20763-2.rs | 2 +- src/test/ui/issues/issue-20825-2.rs | 2 +- src/test/ui/issues/issue-21140.rs | 2 +- src/test/ui/issues/issue-21174-2.rs | 2 +- src/test/ui/issues/issue-21245.rs | 2 +- src/test/ui/issues/issue-21363.rs | 2 +- src/test/ui/issues/issue-21402.rs | 2 +- src/test/ui/issues/issue-21520.rs | 2 +- src/test/ui/issues/issue-21622.rs | 2 +- src/test/ui/issues/issue-21726.rs | 2 +- src/test/ui/issues/issue-22066.rs | 2 +- src/test/ui/issues/issue-22356.rs | 2 +- src/test/ui/issues/issue-22375.rs | 2 +- src/test/ui/issues/issue-22471.rs | 2 +- src/test/ui/issues/issue-22777.rs | 2 +- src/test/ui/issues/issue-22781.rs | 2 +- src/test/ui/issues/issue-22814.rs | 2 +- src/test/ui/issues/issue-2311-2.rs | 2 +- src/test/ui/issues/issue-2311.rs | 2 +- src/test/ui/issues/issue-2312.rs | 2 +- src/test/ui/issues/issue-23442.rs | 2 +- src/test/ui/issues/issue-24085.rs | 2 +- src/test/ui/issues/issue-24161.rs | 2 +- src/test/ui/issues/issue-24227.rs | 2 +- src/test/ui/issues/issue-24338.rs | 2 +- src/test/ui/issues/issue-24389.rs | 2 +- src/test/ui/issues/issue-24434.rs | 2 +- src/test/ui/issues/issue-2502.rs | 2 +- src/test/ui/issues/issue-25180.rs | 2 +- src/test/ui/issues/issue-25394.rs | 2 +- src/test/ui/issues/issue-25579.rs | 2 +- src/test/ui/issues/issue-26095.rs | 2 +- src/test/ui/issues/issue-2611-3.rs | 2 +- src/test/ui/issues/issue-26205.rs | 2 +- src/test/ui/issues/issue-26646.rs | 2 +- src/test/ui/issues/issue-27105.rs | 2 +- src/test/ui/issues/issue-27281.rs | 2 +- src/test/ui/issues/issue-27583.rs | 2 +- src/test/ui/issues/issue-27889.rs | 2 +- src/test/ui/issues/issue-2804-2.rs | 2 +- src/test/ui/issues/issue-28279.rs | 2 +- src/test/ui/issues/issue-28561.rs | 2 +- src/test/ui/issues/issue-28822.rs | 2 +- src/test/ui/issues/issue-28871.rs | 2 +- src/test/ui/issues/issue-28936.rs | 2 +- src/test/ui/issues/issue-28999.rs | 2 +- src/test/ui/issues/issue-29030.rs | 2 +- src/test/ui/issues/issue-29037.rs | 2 +- src/test/ui/issues/issue-29048.rs | 2 +- src/test/ui/issues/issue-29071.rs | 2 +- src/test/ui/issues/issue-29276.rs | 2 +- src/test/ui/issues/issue-29516.rs | 2 +- src/test/ui/issues/issue-29540.rs | 2 +- src/test/ui/issues/issue-29710.rs | 2 +- src/test/ui/issues/issue-29740.rs | 2 +- src/test/ui/issues/issue-29743.rs | 3 +-- src/test/ui/issues/issue-31260.rs | 2 +- src/test/ui/issues/issue-3149.rs | 2 +- src/test/ui/issues/issue-31597.rs | 2 +- src/test/ui/issues/issue-32324.rs | 2 +- src/test/ui/issues/issue-33140-traitobject-crate.rs | 2 +- src/test/ui/issues/issue-33903.rs | 2 +- src/test/ui/issues/issue-3424.rs | 2 +- src/test/ui/issues/issue-34751.rs | 2 +- src/test/ui/issues/issue-34780.rs | 2 +- src/test/ui/issues/issue-35376.rs | 2 +- src/test/ui/issues/issue-36075.rs | 2 +- src/test/ui/issues/issue-3609.rs | 2 +- src/test/ui/issues/issue-37323.rs | 2 +- src/test/ui/issues/issue-37655.rs | 2 +- src/test/ui/issues/issue-37725.rs | 2 +- src/test/ui/issues/issue-38875/issue-38875.rs | 2 +- src/test/ui/issues/issue-3888-2.rs | 2 +- src/test/ui/issues/issue-39089.rs | 2 +- src/test/ui/issues/issue-39467.rs | 2 +- src/test/ui/issues/issue-3979-2.rs | 2 +- src/test/ui/issues/issue-39984.rs | 2 +- src/test/ui/issues/issue-40136.rs | 2 +- src/test/ui/issues/issue-4025.rs | 2 +- src/test/ui/issues/issue-40510-2.rs | 2 +- src/test/ui/issues/issue-40510-4.rs | 2 +- src/test/ui/issues/issue-40962.rs | 2 +- src/test/ui/issues/issue-41272.rs | 2 +- src/test/ui/issues/issue-41298.rs | 2 +- src/test/ui/issues/issue-41628.rs | 2 +- .../ui/issues/issue-41936-variance-coerce-unsized-cycle.rs | 2 +- src/test/ui/issues/issue-41998.rs | 2 +- src/test/ui/issues/issue-42467.rs | 2 +- src/test/ui/issues/issue-42956.rs | 2 +- src/test/ui/issues/issue-43057.rs | 2 +- src/test/ui/issues/issue-43357.rs | 2 +- src/test/ui/issues/issue-43483.rs | 2 +- src/test/ui/issues/issue-44247.rs | 2 +- src/test/ui/issues/issue-44373-2.rs | 2 +- src/test/ui/issues/issue-4464.rs | 2 +- src/test/ui/issues/issue-44730.rs | 2 +- src/test/ui/issues/issue-44851.rs | 2 +- src/test/ui/issues/issue-45425.rs | 2 +- src/test/ui/issues/issue-46959.rs | 2 +- src/test/ui/issues/issue-46964.rs | 2 +- src/test/ui/issues/issue-47094.rs | 2 +- src/test/ui/issues/issue-47673.rs | 2 +- src/test/ui/issues/issue-47703-1.rs | 2 +- src/test/ui/issues/issue-47703-tuple.rs | 2 +- src/test/ui/issues/issue-47703.rs | 2 +- src/test/ui/issues/issue-47722.rs | 2 +- src/test/ui/issues/issue-47789.rs | 2 +- src/test/ui/issues/issue-4830.rs | 2 +- src/test/ui/issues/issue-48551.rs | 2 +- src/test/ui/issues/issue-49556.rs | 2 +- src/test/ui/issues/issue-49579.rs | 2 +- src/test/ui/issues/issue-50187.rs | 2 +- src/test/ui/issues/issue-50471.rs | 2 +- src/test/ui/issues/issue-50518.rs | 2 +- src/test/ui/issues/issue-51655.rs | 2 +- src/test/ui/issues/issue-52992.rs | 2 +- src/test/ui/issues/issue-53419.rs | 2 +- src/test/ui/issues/issue-5353.rs | 2 +- src/test/ui/issues/issue-53568.rs | 2 +- src/test/ui/issues/issue-53675-a-test-called-panic.rs | 2 +- src/test/ui/issues/issue-54387.rs | 2 +- src/test/ui/issues/issue-54521-1.rs | 2 +- src/test/ui/issues/issue-54943-1.rs | 2 +- src/test/ui/issues/issue-54943-2.rs | 2 +- src/test/ui/issues/issue-54943-3.rs | 2 +- src/test/ui/issues/issue-5500-1.rs | 2 +- src/test/ui/issues/issue-5572.rs | 2 +- src/test/ui/issues/issue-56128.rs | 2 +- src/test/ui/issues/issue-56411-aux.rs | 2 +- src/test/ui/issues/issue-57156.rs | 2 +- src/test/ui/issues/issue-57162.rs | 2 +- src/test/ui/issues/issue-57410-1.rs | 2 +- src/test/ui/issues/issue-57410.rs | 2 +- src/test/ui/issues/issue-5900.rs | 2 +- src/test/ui/issues/issue-5950.rs | 2 +- src/test/ui/issues/issue-60662.rs | 2 +- src/test/ui/issues/issue-60662.stdout | 2 +- src/test/ui/issues/issue-6341.rs | 2 +- src/test/ui/issues/issue-6557.rs | 2 +- src/test/ui/issues/issue-6898.rs | 2 +- src/test/ui/issues/issue-6991.rs | 2 +- src/test/ui/issues/issue-7268.rs | 2 +- src/test/ui/issues/issue-7607-2.rs | 2 +- .../ui/issues/issue-7673-cast-generically-implemented-trait.rs | 2 +- .../issue-8171-default-method-self-inherit-builtin-trait.rs | 2 +- src/test/ui/issues/issue-8398.rs | 2 +- src/test/ui/issues/issue-8521.rs | 2 +- src/test/ui/issues/issue-8578.rs | 2 +- src/test/ui/issues/issue-9110.rs | 2 +- src/test/ui/issues/issue-9249.rs | 2 +- .../ui/lint/issue-47390-unused-variable-in-struct-pattern.rs | 2 +- .../ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs | 2 +- src/test/ui/lint/issue-54099-camel-case-underscore-types.rs | 2 +- src/test/ui/lint/unused_import_warning_issue_45268.rs | 2 +- .../closure-requirements/issue-58127-mutliple-requirements.rs | 2 +- src/test/ui/nll/issue-16223.rs | 2 +- src/test/ui/nll/issue-21114-ebfull.rs | 2 +- src/test/ui/nll/issue-21114-kixunil.rs | 2 +- src/test/ui/nll/issue-22323-temp-destruction.rs | 2 +- src/test/ui/nll/issue-30104.rs | 2 +- src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs | 2 +- src/test/ui/nll/issue-43058.rs | 2 +- src/test/ui/nll/issue-47022.rs | 2 +- src/test/ui/nll/issue-50716-1.rs | 2 +- src/test/ui/nll/issue-51351.rs | 2 +- src/test/ui/nll/issue-52078.rs | 2 +- src/test/ui/nll/issue-53119.rs | 2 +- src/test/ui/nll/issue-53570.rs | 2 +- src/test/ui/nll/issue-55344.rs | 2 +- src/test/ui/nll/issue-55651.rs | 2 +- src/test/ui/nll/issue-57280-1.rs | 2 +- src/test/ui/nll/issue-57280.rs | 2 +- src/test/ui/nll/issue-61311-normalize.rs | 2 +- src/test/ui/nll/issue-61320-normalize.rs | 2 +- src/test/ui/nll/relate_tys/issue-48071.rs | 2 +- src/test/ui/nll/ty-outlives/issue-53789-1.rs | 2 +- src/test/ui/nll/ty-outlives/issue-53789-2.rs | 2 +- src/test/ui/nll/ty-outlives/issue-55756.rs | 2 +- src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs | 2 +- src/test/ui/no-warn-on-field-replace-issue-34101.rs | 2 +- src/test/ui/proc-macro/dollar-crate-issue-57089.rs | 2 +- .../regions/issue-56537-closure-uses-region-from-container.rs | 2 +- src/test/ui/resolve/issue-57523.rs | 2 +- src/test/ui/rfc-2093-infer-outlives/issue-54467.rs | 2 +- src/test/ui/rust-2018/uniform-paths/issue-56596-2.rs | 2 +- src/test/ui/span/issue-24690.rs | 2 +- src/test/ui/traits/traits-issue-23003-overflow.rs | 2 +- src/test/ui/type-alias-enum-variants/issue-57866.rs | 2 +- .../issue-61801-path-pattern-can-infer.rs | 2 +- .../typeck/issue-55810-must-typeck-match-pats-before-guards.rs | 2 +- 267 files changed, 267 insertions(+), 268 deletions(-) diff --git a/src/test/ui/async-await/issues/issue-53249.rs b/src/test/ui/async-await/issues/issue-53249.rs index 5cae070444460..e9079bfdd853b 100644 --- a/src/test/ui/async-await/issues/issue-53249.rs +++ b/src/test/ui/async-await/issues/issue-53249.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // edition:2018 #![feature(arbitrary_self_types)] diff --git a/src/test/ui/async-await/issues/issue-54974.rs b/src/test/ui/async-await/issues/issue-54974.rs index 9adc0a8232388..b602ef153e621 100644 --- a/src/test/ui/async-await/issues/issue-54974.rs +++ b/src/test/ui/async-await/issues/issue-54974.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // edition:2018 use std::sync::Arc; diff --git a/src/test/ui/async-await/issues/issue-60518.rs b/src/test/ui/async-await/issues/issue-60518.rs index 1ca051607518e..69bbdd0e83a5d 100644 --- a/src/test/ui/async-await/issues/issue-60518.rs +++ b/src/test/ui/async-await/issues/issue-60518.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // edition:2018 // This is a regression test to ensure that simple bindings (where replacement arguments aren't diff --git a/src/test/ui/borrowck/issue-55552-ascribe-wildcard-to-structured-pattern.rs b/src/test/ui/borrowck/issue-55552-ascribe-wildcard-to-structured-pattern.rs index 1d98067ce738c..b87ef3baa4aa7 100644 --- a/src/test/ui/borrowck/issue-55552-ascribe-wildcard-to-structured-pattern.rs +++ b/src/test/ui/borrowck/issue-55552-ascribe-wildcard-to-structured-pattern.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // rust-lang/rust#55552: The strategy pnkfelix landed in PR #55274 // (for ensuring that NLL respects user-provided lifetime annotations) diff --git a/src/test/ui/closure-expected-type/issue-24421.rs b/src/test/ui/closure-expected-type/issue-24421.rs index f7b4f2b24549e..2e104b599bd75 100644 --- a/src/test/ui/closure-expected-type/issue-24421.rs +++ b/src/test/ui/closure-expected-type/issue-24421.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn test(f: F) {} diff --git a/src/test/ui/consts/issue-62045.rs b/src/test/ui/consts/issue-62045.rs index efeb9fc551cc9..5abed374a6d61 100644 --- a/src/test/ui/consts/issue-62045.rs +++ b/src/test/ui/consts/issue-62045.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn main() { assert_eq!(&mut [0; 1][..], &mut []); diff --git a/src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs b/src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs index 2718e89a3f214..4cb9bd1975a7f 100644 --- a/src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs +++ b/src/test/ui/dyn-keyword/issue-56327-dyn-trait-in-macro-is-okay.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // rust-lang/rust#56327: Some occurrences of `dyn` within a macro are // not instances of identifiers, and thus should *not* be caught by the diff --git a/src/test/ui/feature-gate/issue-43106-gating-of-macro_escape.rs b/src/test/ui/feature-gate/issue-43106-gating-of-macro_escape.rs index dab946bb81810..75a3d9124ebae 100644 --- a/src/test/ui/feature-gate/issue-43106-gating-of-macro_escape.rs +++ b/src/test/ui/feature-gate/issue-43106-gating-of-macro_escape.rs @@ -3,7 +3,7 @@ // `#![macro_escape]` is incompatible with crate-level `#![macro_use]` // already present in issue-43106-gating-of-builtin-attrs. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![macro_escape] //~^ WARN macro_escape is a deprecated synonym for macro_use diff --git a/src/test/ui/generator/issue-53548-1.rs b/src/test/ui/generator/issue-53548-1.rs index 395456ce7c65b..173ae3c6fb6b7 100644 --- a/src/test/ui/generator/issue-53548-1.rs +++ b/src/test/ui/generator/issue-53548-1.rs @@ -2,7 +2,7 @@ // but which encountered the same ICE/error. See `issue-53548.rs` // for details. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::cell::RefCell; use std::rc::Rc; diff --git a/src/test/ui/generator/issue-53548.rs b/src/test/ui/generator/issue-53548.rs index 8136c65923b79..3ebabb914622c 100644 --- a/src/test/ui/generator/issue-53548.rs +++ b/src/test/ui/generator/issue-53548.rs @@ -15,7 +15,7 @@ // also analogous to what we would do for higher-ranked regions // appearing within the trait in other positions). // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(generators)] diff --git a/src/test/ui/impl-trait/issues/issue-42479.rs b/src/test/ui/impl-trait/issues/issue-42479.rs index 7d69cd0a3038f..efc1f975d16ed 100644 --- a/src/test/ui/impl-trait/issues/issue-42479.rs +++ b/src/test/ui/impl-trait/issues/issue-42479.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::iter::once; diff --git a/src/test/ui/impl-trait/issues/issue-49376.rs b/src/test/ui/impl-trait/issues/issue-49376.rs index 12e69b16adf0b..e4472fcc16097 100644 --- a/src/test/ui/impl-trait/issues/issue-49376.rs +++ b/src/test/ui/impl-trait/issues/issue-49376.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Tests for nested self-reference which caused a stack overflow. diff --git a/src/test/ui/impl-trait/issues/issue-52128.rs b/src/test/ui/impl-trait/issues/issue-52128.rs index ac26c10e55d83..5afd380dd4f2e 100644 --- a/src/test/ui/impl-trait/issues/issue-52128.rs +++ b/src/test/ui/impl-trait/issues/issue-52128.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(warnings)] diff --git a/src/test/ui/impl-trait/issues/issue-55608-captures-empty-region.rs b/src/test/ui/impl-trait/issues/issue-55608-captures-empty-region.rs index 0c07101bb7ba0..0c34c97e2584f 100644 --- a/src/test/ui/impl-trait/issues/issue-55608-captures-empty-region.rs +++ b/src/test/ui/impl-trait/issues/issue-55608-captures-empty-region.rs @@ -1,7 +1,7 @@ // This used to ICE because it creates an `impl Trait` that captures a // hidden empty region. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn server() -> impl FilterBase2 { segment2(|| { loop { } }).map2(|| "") diff --git a/src/test/ui/impl-trait/issues/issue-57464-unexpected-regions.rs b/src/test/ui/impl-trait/issues/issue-57464-unexpected-regions.rs index ed066ce19243e..c4f738a34b6f3 100644 --- a/src/test/ui/impl-trait/issues/issue-57464-unexpected-regions.rs +++ b/src/test/ui/impl-trait/issues/issue-57464-unexpected-regions.rs @@ -5,7 +5,7 @@ // opaque type. As all regions are now required to outlive the bound in an // opaque type we avoid the issue here. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct A(F); diff --git a/src/test/ui/imports/issue-53140.rs b/src/test/ui/imports/issue-53140.rs index 1854ddf96b8db..7b4cc176806aa 100644 --- a/src/test/ui/imports/issue-53140.rs +++ b/src/test/ui/imports/issue-53140.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass mod m { pub struct S(u8); diff --git a/src/test/ui/imports/issue-55811.rs b/src/test/ui/imports/issue-55811.rs index 8cb602d868cd4..2df328cca8933 100644 --- a/src/test/ui/imports/issue-55811.rs +++ b/src/test/ui/imports/issue-55811.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // aux-build:issue-55811.rs extern crate issue_55811; diff --git a/src/test/ui/imports/issue-56263.rs b/src/test/ui/imports/issue-56263.rs index 4763ae4be9995..363781f2daffe 100644 --- a/src/test/ui/imports/issue-56263.rs +++ b/src/test/ui/imports/issue-56263.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // edition:2018 use ::std; diff --git a/src/test/ui/issues/issue-10396.rs b/src/test/ui/issues/issue-10396.rs index 0781e5e3ed990..d16ea3dc344c1 100644 --- a/src/test/ui/issues/issue-10396.rs +++ b/src/test/ui/issues/issue-10396.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #[derive(Debug)] enum Foo<'s> { diff --git a/src/test/ui/issues/issue-10456.rs b/src/test/ui/issues/issue-10456.rs index 7eac095de5da4..9f8d259552085 100644 --- a/src/test/ui/issues/issue-10456.rs +++ b/src/test/ui/issues/issue-10456.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 pub struct Foo; diff --git a/src/test/ui/issues/issue-10853.rs b/src/test/ui/issues/issue-10853.rs index c9de39feda691..3dcabf9b16536 100644 --- a/src/test/ui/issues/issue-10853.rs +++ b/src/test/ui/issues/issue-10853.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 #![deny(missing_docs)] diff --git a/src/test/ui/issues/issue-10902.rs b/src/test/ui/issues/issue-10902.rs index d53ce9a1db86f..162482d49abd5 100644 --- a/src/test/ui/issues/issue-10902.rs +++ b/src/test/ui/issues/issue-10902.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-11384.rs b/src/test/ui/issues/issue-11384.rs index 443c2be08bbd0..0105b4d223e4d 100644 --- a/src/test/ui/issues/issue-11384.rs +++ b/src/test/ui/issues/issue-11384.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait Common { fn dummy(&self) { } } diff --git a/src/test/ui/issues/issue-11592.rs b/src/test/ui/issues/issue-11592.rs index 0298f83baf81c..a4611f2f90ecb 100644 --- a/src/test/ui/issues/issue-11592.rs +++ b/src/test/ui/issues/issue-11592.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass //! Ensure the private trait Bar isn't complained about. #![deny(missing_docs)] diff --git a/src/test/ui/issues/issue-11612.rs b/src/test/ui/issues/issue-11612.rs index 553648a5ebc2e..9f7f1cc6fc7db 100644 --- a/src/test/ui/issues/issue-11612.rs +++ b/src/test/ui/issues/issue-11612.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // #11612 // We weren't updating the auto adjustments with all the resolved diff --git a/src/test/ui/issues/issue-11869.rs b/src/test/ui/issues/issue-11869.rs index a44094bfb2391..b300f4593a7c6 100644 --- a/src/test/ui/issues/issue-11869.rs +++ b/src/test/ui/issues/issue-11869.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-12729.rs b/src/test/ui/issues/issue-12729.rs index 67c1bdc32ede9..aa0b04af28e25 100644 --- a/src/test/ui/issues/issue-12729.rs +++ b/src/test/ui/issues/issue-12729.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-13105.rs b/src/test/ui/issues/issue-13105.rs index 2410e2f136704..15a98c779833a 100644 --- a/src/test/ui/issues/issue-13105.rs +++ b/src/test/ui/issues/issue-13105.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait Foo { diff --git a/src/test/ui/issues/issue-13167.rs b/src/test/ui/issues/issue-13167.rs index e04faabb7e8e0..8584c98decf4e 100644 --- a/src/test/ui/issues/issue-13167.rs +++ b/src/test/ui/issues/issue-13167.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 use std::slice; diff --git a/src/test/ui/issues/issue-13405.rs b/src/test/ui/issues/issue-13405.rs index fb48abe26484a..732172b23ed19 100644 --- a/src/test/ui/issues/issue-13405.rs +++ b/src/test/ui/issues/issue-13405.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unused_variables)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-13703.rs b/src/test/ui/issues/issue-13703.rs index fe5458a7d7c07..424c99974b3eb 100644 --- a/src/test/ui/issues/issue-13703.rs +++ b/src/test/ui/issues/issue-13703.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize } diff --git a/src/test/ui/issues/issue-13775.rs b/src/test/ui/issues/issue-13775.rs index 0359bb581d585..f5977effc4093 100644 --- a/src/test/ui/issues/issue-13775.rs +++ b/src/test/ui/issues/issue-13775.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait Foo { diff --git a/src/test/ui/issues/issue-13837.rs b/src/test/ui/issues/issue-13837.rs index 06790fbd32457..645b1c0eb8741 100644 --- a/src/test/ui/issues/issue-13837.rs +++ b/src/test/ui/issues/issue-13837.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-14082.rs b/src/test/ui/issues/issue-14082.rs index e5f1b492f275b..52b8c86802f06 100644 --- a/src/test/ui/issues/issue-14082.rs +++ b/src/test/ui/issues/issue-14082.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 #![allow(unused_imports, dead_code)] diff --git a/src/test/ui/issues/issue-14254.rs b/src/test/ui/issues/issue-14254.rs index 8b04fa192ada1..6f9308376415d 100644 --- a/src/test/ui/issues/issue-14254.rs +++ b/src/test/ui/issues/issue-14254.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait Foo: Sized { diff --git a/src/test/ui/issues/issue-14837.rs b/src/test/ui/issues/issue-14837.rs index a276e27f9dcc4..a83bc4150021f 100644 --- a/src/test/ui/issues/issue-14837.rs +++ b/src/test/ui/issues/issue-14837.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 #[deny(dead_code)] diff --git a/src/test/ui/issues/issue-14901.rs b/src/test/ui/issues/issue-14901.rs index c164658331e93..5319abbdf0e5c 100644 --- a/src/test/ui/issues/issue-14901.rs +++ b/src/test/ui/issues/issue-14901.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait Reader {} enum Wrapper<'a> { diff --git a/src/test/ui/issues/issue-14933.rs b/src/test/ui/issues/issue-14933.rs index f229c0f7c26cf..bd95332cabaed 100644 --- a/src/test/ui/issues/issue-14933.rs +++ b/src/test/ui/issues/issue-14933.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 pub type BigRat = T; diff --git a/src/test/ui/issues/issue-14959.rs b/src/test/ui/issues/issue-14959.rs index bd6c7a2bda9f0..e31a9431558f6 100644 --- a/src/test/ui/issues/issue-14959.rs +++ b/src/test/ui/issues/issue-14959.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 #![feature(fn_traits, unboxed_closures)] diff --git a/src/test/ui/issues/issue-15689-2.rs b/src/test/ui/issues/issue-15689-2.rs index 1731a356ccd19..83dcb1406f89f 100644 --- a/src/test/ui/issues/issue-15689-2.rs +++ b/src/test/ui/issues/issue-15689-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-15735.rs b/src/test/ui/issues/issue-15735.rs index 0da4d4a620bf9..f9ba34405f698 100644 --- a/src/test/ui/issues/issue-15735.rs +++ b/src/test/ui/issues/issue-15735.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct A<'a> { a: &'a i32, diff --git a/src/test/ui/issues/issue-16596.rs b/src/test/ui/issues/issue-16596.rs index 693dea436bb06..e7a0963025117 100644 --- a/src/test/ui/issues/issue-16596.rs +++ b/src/test/ui/issues/issue-16596.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] trait MatrixRow { fn dummy(&self) { }} diff --git a/src/test/ui/issues/issue-16668.rs b/src/test/ui/issues/issue-16668.rs index a898ab20a4887..92efb42fe3091 100644 --- a/src/test/ui/issues/issue-16668.rs +++ b/src/test/ui/issues/issue-16668.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct Parser<'a, I, O> { parse: Box Result + 'a> diff --git a/src/test/ui/issues/issue-17121.rs b/src/test/ui/issues/issue-17121.rs index 0f1d4f5410d57..34b1e2099be3f 100644 --- a/src/test/ui/issues/issue-17121.rs +++ b/src/test/ui/issues/issue-17121.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 // ignore-cloudabi no std::fs diff --git a/src/test/ui/issues/issue-17263.rs b/src/test/ui/issues/issue-17263.rs index f24acb7b304e6..7e9ff68548225 100644 --- a/src/test/ui/issues/issue-17263.rs +++ b/src/test/ui/issues/issue-17263.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(box_syntax)] diff --git a/src/test/ui/issues/issue-17732.rs b/src/test/ui/issues/issue-17732.rs index 17135c191cafb..5e11fc4fcfb58 100644 --- a/src/test/ui/issues/issue-17732.rs +++ b/src/test/ui/issues/issue-17732.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-17746.rs b/src/test/ui/issues/issue-17746.rs index 847b2eb60bbb5..bab64a4b5ae08 100644 --- a/src/test/ui/issues/issue-17746.rs +++ b/src/test/ui/issues/issue-17746.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Regression test for #17746 diff --git a/src/test/ui/issues/issue-17904.rs b/src/test/ui/issues/issue-17904.rs index d916abb9c7384..c3f504ac1b9d7 100644 --- a/src/test/ui/issues/issue-17904.rs +++ b/src/test/ui/issues/issue-17904.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Test that we can parse where clauses on various forms of tuple // structs. diff --git a/src/test/ui/issues/issue-18083.rs b/src/test/ui/issues/issue-18083.rs index f159ed4a0cecc..36420ec142ea5 100644 --- a/src/test/ui/issues/issue-18083.rs +++ b/src/test/ui/issues/issue-18083.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unused_imports)] // These crossed imports should resolve fine, and not block on diff --git a/src/test/ui/issues/issue-18088.rs b/src/test/ui/issues/issue-18088.rs index 06f259958f822..c557b5a6512b9 100644 --- a/src/test/ui/issues/issue-18088.rs +++ b/src/test/ui/issues/issue-18088.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait Indexable: std::ops::Index { fn index2(&self, i: usize) -> &T { diff --git a/src/test/ui/issues/issue-18188.rs b/src/test/ui/issues/issue-18188.rs index da10a8647bac6..ce166724affe7 100644 --- a/src/test/ui/issues/issue-18188.rs +++ b/src/test/ui/issues/issue-18188.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 pub trait Promisable: Send + Sync {} diff --git a/src/test/ui/issues/issue-1821.rs b/src/test/ui/issues/issue-1821.rs index db97a507b689a..76ee9c3edb0c2 100644 --- a/src/test/ui/issues/issue-1821.rs +++ b/src/test/ui/issues/issue-1821.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/issues/issue-18446-2.rs b/src/test/ui/issues/issue-18446-2.rs index 6b984c13da5d3..85422d4d2611a 100644 --- a/src/test/ui/issues/issue-18446-2.rs +++ b/src/test/ui/issues/issue-18446-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Test that methods in trait impls should override default methods. diff --git a/src/test/ui/issues/issue-18738.rs b/src/test/ui/issues/issue-18738.rs index ec4429234bc59..bcc1ec03f2625 100644 --- a/src/test/ui/issues/issue-18738.rs +++ b/src/test/ui/issues/issue-18738.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #[derive(Eq, PartialEq, PartialOrd, Ord)] enum Test<'a> { diff --git a/src/test/ui/issues/issue-18809.rs b/src/test/ui/issues/issue-18809.rs index 9b8275f811999..cc5b4a64c6d26 100644 --- a/src/test/ui/issues/issue-18809.rs +++ b/src/test/ui/issues/issue-18809.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Tup { type T0; type T1; diff --git a/src/test/ui/issues/issue-18906.rs b/src/test/ui/issues/issue-18906.rs index 387fd41fb7ae7..976a9f49b9d0e 100644 --- a/src/test/ui/issues/issue-18906.rs +++ b/src/test/ui/issues/issue-18906.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-18988.rs b/src/test/ui/issues/issue-18988.rs index 6dbfd3a0a982a..708965d81d8d6 100644 --- a/src/test/ui/issues/issue-18988.rs +++ b/src/test/ui/issues/issue-18988.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] pub trait Foo : Send { } diff --git a/src/test/ui/issues/issue-19037.rs b/src/test/ui/issues/issue-19037.rs index 30497d3e94f58..74623da145470 100644 --- a/src/test/ui/issues/issue-19037.rs +++ b/src/test/ui/issues/issue-19037.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-19081.rs b/src/test/ui/issues/issue-19081.rs index 0948cd3271b1c..fbfe4c6f83911 100644 --- a/src/test/ui/issues/issue-19081.rs +++ b/src/test/ui/issues/issue-19081.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait Hasher { type State; diff --git a/src/test/ui/issues/issue-19097.rs b/src/test/ui/issues/issue-19097.rs index c800e0bd12a08..2f4b0d575bb3c 100644 --- a/src/test/ui/issues/issue-19097.rs +++ b/src/test/ui/issues/issue-19097.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // regression test for #19097 diff --git a/src/test/ui/issues/issue-19098.rs b/src/test/ui/issues/issue-19098.rs index 37c0d7f05222b..3d05f11b69712 100644 --- a/src/test/ui/issues/issue-19098.rs +++ b/src/test/ui/issues/issue-19098.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait Handler { fn handle(&self, _: &mut String); } diff --git a/src/test/ui/issues/issue-19102.rs b/src/test/ui/issues/issue-19102.rs index 76ed3efc4ed49..1f32d10b644ab 100644 --- a/src/test/ui/issues/issue-19102.rs +++ b/src/test/ui/issues/issue-19102.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_imports)] #![deny(unused_qualifications)] diff --git a/src/test/ui/issues/issue-19129-1.rs b/src/test/ui/issues/issue-19129-1.rs index e17ee053f33d8..03a9691018ae1 100644 --- a/src/test/ui/issues/issue-19129-1.rs +++ b/src/test/ui/issues/issue-19129-1.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait Trait { diff --git a/src/test/ui/issues/issue-19129-2.rs b/src/test/ui/issues/issue-19129-2.rs index 30c64573a1532..991d79d415943 100644 --- a/src/test/ui/issues/issue-19129-2.rs +++ b/src/test/ui/issues/issue-19129-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_variables)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-19398.rs b/src/test/ui/issues/issue-19398.rs index 28d266a1d61a2..a9d0acaa26f4d 100644 --- a/src/test/ui/issues/issue-19398.rs +++ b/src/test/ui/issues/issue-19398.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait T { diff --git a/src/test/ui/issues/issue-19479.rs b/src/test/ui/issues/issue-19479.rs index c134d85c7e93d..70bfe7213f2ca 100644 --- a/src/test/ui/issues/issue-19479.rs +++ b/src/test/ui/issues/issue-19479.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait Base { diff --git a/src/test/ui/issues/issue-19631.rs b/src/test/ui/issues/issue-19631.rs index 015758dd6e1d2..694e6dcd15a9e 100644 --- a/src/test/ui/issues/issue-19631.rs +++ b/src/test/ui/issues/issue-19631.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-19632.rs b/src/test/ui/issues/issue-19632.rs index ddd87a9f6e978..203976079fb88 100644 --- a/src/test/ui/issues/issue-19632.rs +++ b/src/test/ui/issues/issue-19632.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-19850.rs b/src/test/ui/issues/issue-19850.rs index d51cf0cfcb980..4a578c398a826 100644 --- a/src/test/ui/issues/issue-19850.rs +++ b/src/test/ui/issues/issue-19850.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_variables)] // Test that `::Output` and `Self::Output` are accepted as type annotations in let // bindings diff --git a/src/test/ui/issues/issue-19982.rs b/src/test/ui/issues/issue-19982.rs index fb88781ee283a..12419c109c5d4 100644 --- a/src/test/ui/issues/issue-19982.rs +++ b/src/test/ui/issues/issue-19982.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(fn_traits, unboxed_closures)] diff --git a/src/test/ui/issues/issue-20009.rs b/src/test/ui/issues/issue-20009.rs index 730f1a9a162a2..f289e58c50e68 100644 --- a/src/test/ui/issues/issue-20009.rs +++ b/src/test/ui/issues/issue-20009.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Check that associated types are `Sized` // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-20186.rs b/src/test/ui/issues/issue-20186.rs index 28cbde772c51d..54d68f100521d 100644 --- a/src/test/ui/issues/issue-20186.rs +++ b/src/test/ui/issues/issue-20186.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unused_variables)] struct Foo; diff --git a/src/test/ui/issues/issue-20396.rs b/src/test/ui/issues/issue-20396.rs index 5e0411b2cd259..4a34f8b385f0f 100644 --- a/src/test/ui/issues/issue-20396.rs +++ b/src/test/ui/issues/issue-20396.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/src/test/ui/issues/issue-20414.rs b/src/test/ui/issues/issue-20414.rs index 5c6929d45d199..2496e342a2fb1 100644 --- a/src/test/ui/issues/issue-20414.rs +++ b/src/test/ui/issues/issue-20414.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-20454.rs b/src/test/ui/issues/issue-20454.rs index 13ce1daf30a2a..46cae33f102ec 100644 --- a/src/test/ui/issues/issue-20454.rs +++ b/src/test/ui/issues/issue-20454.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_must_use)] use std::thread; diff --git a/src/test/ui/issues/issue-2063-resource.rs b/src/test/ui/issues/issue-2063-resource.rs index ea4cbf2cedeb7..1d0527447ba51 100644 --- a/src/test/ui/issues/issue-2063-resource.rs +++ b/src/test/ui/issues/issue-2063-resource.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // test that autoderef of a type like this does not // cause compiler to loop. Note that no instances diff --git a/src/test/ui/issues/issue-20763-1.rs b/src/test/ui/issues/issue-20763-1.rs index 0f0ac8f646203..858d313fc3235 100644 --- a/src/test/ui/issues/issue-20763-1.rs +++ b/src/test/ui/issues/issue-20763-1.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-20763-2.rs b/src/test/ui/issues/issue-20763-2.rs index e3b566d050340..aa5bed209eed1 100644 --- a/src/test/ui/issues/issue-20763-2.rs +++ b/src/test/ui/issues/issue-20763-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-20825-2.rs b/src/test/ui/issues/issue-20825-2.rs index 7d72ef839eab7..b79a297308279 100644 --- a/src/test/ui/issues/issue-20825-2.rs +++ b/src/test/ui/issues/issue-20825-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait Subscriber { type Input; } diff --git a/src/test/ui/issues/issue-21140.rs b/src/test/ui/issues/issue-21140.rs index 92834bbb0e491..01de901112ecf 100644 --- a/src/test/ui/issues/issue-21140.rs +++ b/src/test/ui/issues/issue-21140.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait Trait where Self::Out: std::fmt::Display { type Out; } diff --git a/src/test/ui/issues/issue-21174-2.rs b/src/test/ui/issues/issue-21174-2.rs index 351a98d5c85b7..c90f91f6a699a 100644 --- a/src/test/ui/issues/issue-21174-2.rs +++ b/src/test/ui/issues/issue-21174-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unused_variables)] trait Trait<'a> { diff --git a/src/test/ui/issues/issue-21245.rs b/src/test/ui/issues/issue-21245.rs index d0aa16bfb1645..c8e55a0cc20a5 100644 --- a/src/test/ui/issues/issue-21245.rs +++ b/src/test/ui/issues/issue-21245.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Regression test for issue #21245. Check that we are able to infer // the types in these examples correctly. It used to be that diff --git a/src/test/ui/issues/issue-21363.rs b/src/test/ui/issues/issue-21363.rs index d5f1eec061d20..acc28cb430b27 100644 --- a/src/test/ui/issues/issue-21363.rs +++ b/src/test/ui/issues/issue-21363.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 #![no_implicit_prelude] diff --git a/src/test/ui/issues/issue-21402.rs b/src/test/ui/issues/issue-21402.rs index 21e0d58b5f4a3..d140b6162ceec 100644 --- a/src/test/ui/issues/issue-21402.rs +++ b/src/test/ui/issues/issue-21402.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-21520.rs b/src/test/ui/issues/issue-21520.rs index 133bcc2360a22..ab4ac7237c787 100644 --- a/src/test/ui/issues/issue-21520.rs +++ b/src/test/ui/issues/issue-21520.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Test that the requirement (in `Bar`) that `T::Bar : 'static` does // not wind up propagating to `T`. diff --git a/src/test/ui/issues/issue-21622.rs b/src/test/ui/issues/issue-21622.rs index 4aae089943f5b..2d4cddac9117f 100644 --- a/src/test/ui/issues/issue-21622.rs +++ b/src/test/ui/issues/issue-21622.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unused_variables)] diff --git a/src/test/ui/issues/issue-21726.rs b/src/test/ui/issues/issue-21726.rs index 1c8284c8295dc..b98cf21669587 100644 --- a/src/test/ui/issues/issue-21726.rs +++ b/src/test/ui/issues/issue-21726.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Regression test for #21726: an issue arose around the rules for // subtyping of projection types that resulted in an unconstrained diff --git a/src/test/ui/issues/issue-22066.rs b/src/test/ui/issues/issue-22066.rs index fbf31aa42437c..8e8ba5dc46c9a 100644 --- a/src/test/ui/issues/issue-22066.rs +++ b/src/test/ui/issues/issue-22066.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait LineFormatter<'a> { type Iter: Iterator + 'a; fn iter(&'a self, line: &'a str) -> Self::Iter; diff --git a/src/test/ui/issues/issue-22356.rs b/src/test/ui/issues/issue-22356.rs index ec4695e5e0ac5..47fad3bb909e5 100644 --- a/src/test/ui/issues/issue-22356.rs +++ b/src/test/ui/issues/issue-22356.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(type_alias_bounds)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-22375.rs b/src/test/ui/issues/issue-22375.rs index 201aea3a05c00..21a1a4c83800a 100644 --- a/src/test/ui/issues/issue-22375.rs +++ b/src/test/ui/issues/issue-22375.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait A> {} fn main() {} diff --git a/src/test/ui/issues/issue-22471.rs b/src/test/ui/issues/issue-22471.rs index befccc19bf8ef..69879ab7fdf1b 100644 --- a/src/test/ui/issues/issue-22471.rs +++ b/src/test/ui/issues/issue-22471.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(type_alias_bounds)] diff --git a/src/test/ui/issues/issue-22777.rs b/src/test/ui/issues/issue-22777.rs index 81efb250dfa96..a31f059408ff3 100644 --- a/src/test/ui/issues/issue-22777.rs +++ b/src/test/ui/issues/issue-22777.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // This test is reduced from libsyntax. It is just checking that we // can successfully deal with a "deep" structure, which the drop-check // was hitting a recursion limit on at one point. diff --git a/src/test/ui/issues/issue-22781.rs b/src/test/ui/issues/issue-22781.rs index 37f40aa042140..d644cec4d5666 100644 --- a/src/test/ui/issues/issue-22781.rs +++ b/src/test/ui/issues/issue-22781.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_variables)] use std::collections::HashMap; use std::collections::hash_map::Entry::Vacant; diff --git a/src/test/ui/issues/issue-22814.rs b/src/test/ui/issues/issue-22814.rs index 065e7edc67e07..4079adfc8b62d 100644 --- a/src/test/ui/issues/issue-22814.rs +++ b/src/test/ui/issues/issue-22814.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Test {} macro_rules! test { diff --git a/src/test/ui/issues/issue-2311-2.rs b/src/test/ui/issues/issue-2311-2.rs index f735338fcdbc9..760d4edaa98d8 100644 --- a/src/test/ui/issues/issue-2311-2.rs +++ b/src/test/ui/issues/issue-2311-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/issues/issue-2311.rs b/src/test/ui/issues/issue-2311.rs index 151ad4e26645b..21ff19f7f0316 100644 --- a/src/test/ui/issues/issue-2311.rs +++ b/src/test/ui/issues/issue-2311.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-2312.rs b/src/test/ui/issues/issue-2312.rs index b445f9581b345..8a94bcbd4cc18 100644 --- a/src/test/ui/issues/issue-2312.rs +++ b/src/test/ui/issues/issue-2312.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/issues/issue-23442.rs b/src/test/ui/issues/issue-23442.rs index 659e1e07942fe..d1e4317e5b469 100644 --- a/src/test/ui/issues/issue-23442.rs +++ b/src/test/ui/issues/issue-23442.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] use std::marker::PhantomData; diff --git a/src/test/ui/issues/issue-24085.rs b/src/test/ui/issues/issue-24085.rs index dc2de922ff008..86e94beb7e255 100644 --- a/src/test/ui/issues/issue-24085.rs +++ b/src/test/ui/issues/issue-24085.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Regression test for #24085. Errors were occurring in region // inference due to the requirement that `'a:b'`, which was getting diff --git a/src/test/ui/issues/issue-24161.rs b/src/test/ui/issues/issue-24161.rs index c5c8651d43bad..f4cdd982ac641 100644 --- a/src/test/ui/issues/issue-24161.rs +++ b/src/test/ui/issues/issue-24161.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #[derive(Copy,Clone)] struct Functions { diff --git a/src/test/ui/issues/issue-24227.rs b/src/test/ui/issues/issue-24227.rs index eaadaf7c449df..12816c235f8d8 100644 --- a/src/test/ui/issues/issue-24227.rs +++ b/src/test/ui/issues/issue-24227.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // This resulted in an ICE. Test for future-proofing // Issue #24227 diff --git a/src/test/ui/issues/issue-24338.rs b/src/test/ui/issues/issue-24338.rs index 09cc99f95077a..3a2c790f85203 100644 --- a/src/test/ui/issues/issue-24338.rs +++ b/src/test/ui/issues/issue-24338.rs @@ -1,5 +1,5 @@ // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait DictLike<'a> { type ItemsIterator: Iterator; diff --git a/src/test/ui/issues/issue-24389.rs b/src/test/ui/issues/issue-24389.rs index 63d1687af5073..7cc7611769ad4 100644 --- a/src/test/ui/issues/issue-24389.rs +++ b/src/test/ui/issues/issue-24389.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct Foo; diff --git a/src/test/ui/issues/issue-24434.rs b/src/test/ui/issues/issue-24434.rs index b500b9d56dd83..4c1bfc03c9a2b 100644 --- a/src/test/ui/issues/issue-24434.rs +++ b/src/test/ui/issues/issue-24434.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // compile-flags:--cfg set1 #![cfg_attr(set1, feature(rustc_attrs))] diff --git a/src/test/ui/issues/issue-2502.rs b/src/test/ui/issues/issue-2502.rs index 9a2bbb82413f6..63151002438c3 100644 --- a/src/test/ui/issues/issue-2502.rs +++ b/src/test/ui/issues/issue-2502.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/ui/issues/issue-25180.rs b/src/test/ui/issues/issue-25180.rs index 12f8f88a17034..29dc07f491427 100644 --- a/src/test/ui/issues/issue-25180.rs +++ b/src/test/ui/issues/issue-25180.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-25394.rs b/src/test/ui/issues/issue-25394.rs index c41b554df142a..2f0ae19fcb15f 100644 --- a/src/test/ui/issues/issue-25394.rs +++ b/src/test/ui/issues/issue-25394.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #[derive(Debug)] struct Row([T]); diff --git a/src/test/ui/issues/issue-25579.rs b/src/test/ui/issues/issue-25579.rs index 32b4b75b0809c..5f5a0f4d2671c 100644 --- a/src/test/ui/issues/issue-25579.rs +++ b/src/test/ui/issues/issue-25579.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass enum Sexpression { Num(()), diff --git a/src/test/ui/issues/issue-26095.rs b/src/test/ui/issues/issue-26095.rs index 1e3cc902e56b2..638f8f5718760 100644 --- a/src/test/ui/issues/issue-26095.rs +++ b/src/test/ui/issues/issue-26095.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-2611-3.rs b/src/test/ui/issues/issue-2611-3.rs index 7335d53f8a640..a95a748e091a2 100644 --- a/src/test/ui/issues/issue-2611-3.rs +++ b/src/test/ui/issues/issue-2611-3.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Tests that impls are allowed to have looser, more permissive bounds // than the traits require. diff --git a/src/test/ui/issues/issue-26205.rs b/src/test/ui/issues/issue-26205.rs index 45ca998a831ef..f5f39ded021ef 100644 --- a/src/test/ui/issues/issue-26205.rs +++ b/src/test/ui/issues/issue-26205.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] use std::ops::{Deref, DerefMut}; diff --git a/src/test/ui/issues/issue-26646.rs b/src/test/ui/issues/issue-26646.rs index d6f51ce9c99dc..86e4bd7e8f8f0 100644 --- a/src/test/ui/issues/issue-26646.rs +++ b/src/test/ui/issues/issue-26646.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(unused_attributes)] #[repr(C)] diff --git a/src/test/ui/issues/issue-27105.rs b/src/test/ui/issues/issue-27105.rs index e7584d941ba6c..3339af364a005 100644 --- a/src/test/ui/issues/issue-27105.rs +++ b/src/test/ui/issues/issue-27105.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::cell::RefCell; use std::rc::Rc; diff --git a/src/test/ui/issues/issue-27281.rs b/src/test/ui/issues/issue-27281.rs index 58b8f07bca6d8..717d8b2c2aa37 100644 --- a/src/test/ui/issues/issue-27281.rs +++ b/src/test/ui/issues/issue-27281.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub trait Trait<'a> { type T; type U; diff --git a/src/test/ui/issues/issue-27583.rs b/src/test/ui/issues/issue-27583.rs index 9981f867bd00b..84c94c7c90580 100644 --- a/src/test/ui/issues/issue-27583.rs +++ b/src/test/ui/issues/issue-27583.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Regression test for issue #27583. Unclear how useful this will be // going forward, since the issue in question was EXTREMELY sensitive // to compiler internals (like the precise numbering of nodes), but diff --git a/src/test/ui/issues/issue-27889.rs b/src/test/ui/issues/issue-27889.rs index bb5a186b457d9..623416a5d0032 100644 --- a/src/test/ui/issues/issue-27889.rs +++ b/src/test/ui/issues/issue-27889.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_assignments)] #![allow(unused_variables)] // Test that a field can have the same name in different variants diff --git a/src/test/ui/issues/issue-2804-2.rs b/src/test/ui/issues/issue-2804-2.rs index 68933fc2e8a3b..d02725505ac19 100644 --- a/src/test/ui/issues/issue-2804-2.rs +++ b/src/test/ui/issues/issue-2804-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Minimized version of issue-2804.rs. Both check that callee IDs don't // clobber the previous node ID in a macro expr diff --git a/src/test/ui/issues/issue-28279.rs b/src/test/ui/issues/issue-28279.rs index e36a9551ab549..bab5df122c87f 100644 --- a/src/test/ui/issues/issue-28279.rs +++ b/src/test/ui/issues/issue-28279.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] use std::rc::Rc; diff --git a/src/test/ui/issues/issue-28561.rs b/src/test/ui/issues/issue-28561.rs index cc4e63696e5f3..1241fb0b1f85f 100644 --- a/src/test/ui/issues/issue-28561.rs +++ b/src/test/ui/issues/issue-28561.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] struct Array { f00: [T; 00], diff --git a/src/test/ui/issues/issue-28822.rs b/src/test/ui/issues/issue-28822.rs index 2c0c01aa827ab..10e5d1dd0ac15 100644 --- a/src/test/ui/issues/issue-28822.rs +++ b/src/test/ui/issues/issue-28822.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] fn main() {} diff --git a/src/test/ui/issues/issue-28871.rs b/src/test/ui/issues/issue-28871.rs index 43564dfcc46bf..210c783de79fe 100644 --- a/src/test/ui/issues/issue-28871.rs +++ b/src/test/ui/issues/issue-28871.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Regression test for #28871. The problem is that rustc encountered // two ways to project, one from a where clause and one from the where // clauses on the trait definition. (In fact, in this case, the where diff --git a/src/test/ui/issues/issue-28936.rs b/src/test/ui/issues/issue-28936.rs index 9267491aafd9d..da9e92c0c8043 100644 --- a/src/test/ui/issues/issue-28936.rs +++ b/src/test/ui/issues/issue-28936.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub type Session = i32; pub struct StreamParser<'a, T> { _tokens: T, diff --git a/src/test/ui/issues/issue-28999.rs b/src/test/ui/issues/issue-28999.rs index 888a8010a2f6b..cec3e25da868c 100644 --- a/src/test/ui/issues/issue-28999.rs +++ b/src/test/ui/issues/issue-28999.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub struct Xyz<'a, V> { pub v: (V, &'a u32), } diff --git a/src/test/ui/issues/issue-29030.rs b/src/test/ui/issues/issue-29030.rs index f9e89840314d4..723e358407f66 100644 --- a/src/test/ui/issues/issue-29030.rs +++ b/src/test/ui/issues/issue-29030.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #[derive(Debug)] struct Message<'a, P: 'a = &'a [u8]> { diff --git a/src/test/ui/issues/issue-29037.rs b/src/test/ui/issues/issue-29037.rs index b1ca76be10d0b..155ed144b3a36 100644 --- a/src/test/ui/issues/issue-29037.rs +++ b/src/test/ui/issues/issue-29037.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // This test ensures that each pointer type `P` is covariant in `X`. diff --git a/src/test/ui/issues/issue-29048.rs b/src/test/ui/issues/issue-29048.rs index e3ccb0d6579d7..039f072f107b2 100644 --- a/src/test/ui/issues/issue-29048.rs +++ b/src/test/ui/issues/issue-29048.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub struct Chan; pub struct ChanSelect<'c, T> { chans: Vec<(&'c Chan, T)>, diff --git a/src/test/ui/issues/issue-29071.rs b/src/test/ui/issues/issue-29071.rs index 7e016a715cd1f..8bdacf2cebb2c 100644 --- a/src/test/ui/issues/issue-29071.rs +++ b/src/test/ui/issues/issue-29071.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-29276.rs b/src/test/ui/issues/issue-29276.rs index 2532dac977293..02b69565953cb 100644 --- a/src/test/ui/issues/issue-29276.rs +++ b/src/test/ui/issues/issue-29276.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct S([u8; { struct Z; 0 }]); diff --git a/src/test/ui/issues/issue-29516.rs b/src/test/ui/issues/issue-29516.rs index 8966730fd8739..d43367e34529b 100644 --- a/src/test/ui/issues/issue-29516.rs +++ b/src/test/ui/issues/issue-29516.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(optin_builtin_traits)] auto trait NotSame {} diff --git a/src/test/ui/issues/issue-29540.rs b/src/test/ui/issues/issue-29540.rs index e472f71aa7f25..6871d3a501fe4 100644 --- a/src/test/ui/issues/issue-29540.rs +++ b/src/test/ui/issues/issue-29540.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #[derive(Debug)] pub struct Config { pub name: String, diff --git a/src/test/ui/issues/issue-29710.rs b/src/test/ui/issues/issue-29710.rs index d4de756e56fa0..bc98d389c6e15 100644 --- a/src/test/ui/issues/issue-29710.rs +++ b/src/test/ui/issues/issue-29710.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(unused_results)] #![allow(dead_code)] diff --git a/src/test/ui/issues/issue-29740.rs b/src/test/ui/issues/issue-29740.rs index 50a03d86acb58..20398890baf74 100644 --- a/src/test/ui/issues/issue-29740.rs +++ b/src/test/ui/issues/issue-29740.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Regression test for #29740. Inefficient MIR matching algorithms // generated way too much code for this sort of case, leading to OOM. diff --git a/src/test/ui/issues/issue-29743.rs b/src/test/ui/issues/issue-29743.rs index 2598b07490e95..250cd7e1b25e9 100644 --- a/src/test/ui/issues/issue-29743.rs +++ b/src/test/ui/issues/issue-29743.rs @@ -1,5 +1,4 @@ -// -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn main() { let mut i = [1, 2, 3]; diff --git a/src/test/ui/issues/issue-31260.rs b/src/test/ui/issues/issue-31260.rs index 608900301e0ef..4db7445b025e5 100644 --- a/src/test/ui/issues/issue-31260.rs +++ b/src/test/ui/issues/issue-31260.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] pub struct Struct { pub field: K, diff --git a/src/test/ui/issues/issue-3149.rs b/src/test/ui/issues/issue-3149.rs index da3fe9ad6ec3e..6ab3bc846a3e3 100644 --- a/src/test/ui/issues/issue-3149.rs +++ b/src/test/ui/issues/issue-3149.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_snake_case)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-31597.rs b/src/test/ui/issues/issue-31597.rs index 1d28a91ea7e01..2872be6d6c855 100644 --- a/src/test/ui/issues/issue-31597.rs +++ b/src/test/ui/issues/issue-31597.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] trait Make { type Out; diff --git a/src/test/ui/issues/issue-32324.rs b/src/test/ui/issues/issue-32324.rs index eaad98d678537..2df547b2e0c92 100644 --- a/src/test/ui/issues/issue-32324.rs +++ b/src/test/ui/issues/issue-32324.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] trait Resources { diff --git a/src/test/ui/issues/issue-33140-traitobject-crate.rs b/src/test/ui/issues/issue-33140-traitobject-crate.rs index 03567b20a8fa6..5f6996c6f5218 100644 --- a/src/test/ui/issues/issue-33140-traitobject-crate.rs +++ b/src/test/ui/issues/issue-33140-traitobject-crate.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![warn(order_dependent_trait_objects)] diff --git a/src/test/ui/issues/issue-33903.rs b/src/test/ui/issues/issue-33903.rs index 6a8305dabebf8..613aa121a47bf 100644 --- a/src/test/ui/issues/issue-33903.rs +++ b/src/test/ui/issues/issue-33903.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Issue 33903: // Built-in indexing should be used even when the index is not diff --git a/src/test/ui/issues/issue-3424.rs b/src/test/ui/issues/issue-3424.rs index a8ff03e2a2481..43d75a6525f9c 100644 --- a/src/test/ui/issues/issue-3424.rs +++ b/src/test/ui/issues/issue-3424.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] // rustc --test ignores2.rs && ./ignores2 diff --git a/src/test/ui/issues/issue-34751.rs b/src/test/ui/issues/issue-34751.rs index a921cb50612dd..6309c0a025723 100644 --- a/src/test/ui/issues/issue-34751.rs +++ b/src/test/ui/issues/issue-34751.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // #34751 ICE: 'rustc' panicked at 'assertion failed: !substs.has_regions_escaping_depth(0)' diff --git a/src/test/ui/issues/issue-34780.rs b/src/test/ui/issues/issue-34780.rs index 3202ef6402162..fbedad35b864a 100644 --- a/src/test/ui/issues/issue-34780.rs +++ b/src/test/ui/issues/issue-34780.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(stable_features)] #![feature(associated_consts)] diff --git a/src/test/ui/issues/issue-35376.rs b/src/test/ui/issues/issue-35376.rs index b415d6554058f..eb139ec4d7f43 100644 --- a/src/test/ui/issues/issue-35376.rs +++ b/src/test/ui/issues/issue-35376.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(specialization)] fn main() {} diff --git a/src/test/ui/issues/issue-36075.rs b/src/test/ui/issues/issue-36075.rs index 00c8cf1fb8aba..bc5bdc3ff9ef7 100644 --- a/src/test/ui/issues/issue-36075.rs +++ b/src/test/ui/issues/issue-36075.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] trait DeclarationParser { type Declaration; diff --git a/src/test/ui/issues/issue-3609.rs b/src/test/ui/issues/issue-3609.rs index e8fc073a15886..57ff12a08ce3c 100644 --- a/src/test/ui/issues/issue-3609.rs +++ b/src/test/ui/issues/issue-3609.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_must_use)] #![allow(dead_code)] #![allow(unused_mut)] diff --git a/src/test/ui/issues/issue-37323.rs b/src/test/ui/issues/issue-37323.rs index 61c8029adf53b..aacb67ae177b2 100644 --- a/src/test/ui/issues/issue-37323.rs +++ b/src/test/ui/issues/issue-37323.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(rustc_attrs)] #![allow(warnings)] diff --git a/src/test/ui/issues/issue-37655.rs b/src/test/ui/issues/issue-37655.rs index fecff4e024606..416854d66f38b 100644 --- a/src/test/ui/issues/issue-37655.rs +++ b/src/test/ui/issues/issue-37655.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Regression test for #37655. The problem was a false edge created by // coercion that wound up requiring that `'a` (in `split()`) outlive // `'b`, which shouldn't be necessary. diff --git a/src/test/ui/issues/issue-37725.rs b/src/test/ui/issues/issue-37725.rs index eefdc72f0c3b3..dd917ce3df36f 100644 --- a/src/test/ui/issues/issue-37725.rs +++ b/src/test/ui/issues/issue-37725.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] trait Foo { fn foo(&self); diff --git a/src/test/ui/issues/issue-38875/issue-38875.rs b/src/test/ui/issues/issue-38875/issue-38875.rs index 68981eaf2b568..124e4d6fd419a 100644 --- a/src/test/ui/issues/issue-38875/issue-38875.rs +++ b/src/test/ui/issues/issue-38875/issue-38875.rs @@ -1,5 +1,5 @@ // aux-build:issue-38875-b.rs -// build-pass (FIXME(62277): could be check-pass?) +// check-pass extern crate issue_38875_b; diff --git a/src/test/ui/issues/issue-3888-2.rs b/src/test/ui/issues/issue-3888-2.rs index 3d4b184ab6bc5..d1ef914bdeccb 100644 --- a/src/test/ui/issues/issue-3888-2.rs +++ b/src/test/ui/issues/issue-3888-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-39089.rs b/src/test/ui/issues/issue-39089.rs index 12ca9e1da0ffb..c7d4f8bd32065 100644 --- a/src/test/ui/issues/issue-39089.rs +++ b/src/test/ui/issues/issue-39089.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] fn f Sized>() {} diff --git a/src/test/ui/issues/issue-39467.rs b/src/test/ui/issues/issue-39467.rs index 86e67560008ea..397751e4ec37a 100644 --- a/src/test/ui/issues/issue-39467.rs +++ b/src/test/ui/issues/issue-39467.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] macro_rules! expr { () => { () } } diff --git a/src/test/ui/issues/issue-3979-2.rs b/src/test/ui/issues/issue-3979-2.rs index f3fcfd2c8fbff..4ec128a4586d4 100644 --- a/src/test/ui/issues/issue-3979-2.rs +++ b/src/test/ui/issues/issue-3979-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 trait A { diff --git a/src/test/ui/issues/issue-39984.rs b/src/test/ui/issues/issue-39984.rs index 613aad1a34f1f..1c9ae26cab22e 100644 --- a/src/test/ui/issues/issue-39984.rs +++ b/src/test/ui/issues/issue-39984.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unreachable_code)] // Regression test for issue #39984. diff --git a/src/test/ui/issues/issue-40136.rs b/src/test/ui/issues/issue-40136.rs index 412ddafdd97ce..29d3fc2d56026 100644 --- a/src/test/ui/issues/issue-40136.rs +++ b/src/test/ui/issues/issue-40136.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] macro_rules! m { () => { 0 } } diff --git a/src/test/ui/issues/issue-4025.rs b/src/test/ui/issues/issue-4025.rs index 6e009ba6eb444..dc534c64c6040 100644 --- a/src/test/ui/issues/issue-4025.rs +++ b/src/test/ui/issues/issue-4025.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unused_mut)] /* diff --git a/src/test/ui/issues/issue-40510-2.rs b/src/test/ui/issues/issue-40510-2.rs index 499fa8a04f207..3ae84be05783f 100644 --- a/src/test/ui/issues/issue-40510-2.rs +++ b/src/test/ui/issues/issue-40510-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused)] fn f() { diff --git a/src/test/ui/issues/issue-40510-4.rs b/src/test/ui/issues/issue-40510-4.rs index 5fad7e4a62917..48bb8d36f5552 100644 --- a/src/test/ui/issues/issue-40510-4.rs +++ b/src/test/ui/issues/issue-40510-4.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused)] fn f() { diff --git a/src/test/ui/issues/issue-40962.rs b/src/test/ui/issues/issue-40962.rs index c051133cbed08..7b91c06819f05 100644 --- a/src/test/ui/issues/issue-40962.rs +++ b/src/test/ui/issues/issue-40962.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass macro_rules! m { ($i:meta) => { #[derive($i)] diff --git a/src/test/ui/issues/issue-41272.rs b/src/test/ui/issues/issue-41272.rs index 9cd2003628635..1f4da46f8944c 100644 --- a/src/test/ui/issues/issue-41272.rs +++ b/src/test/ui/issues/issue-41272.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct Foo; diff --git a/src/test/ui/issues/issue-41298.rs b/src/test/ui/issues/issue-41298.rs index c719664de0d06..a1b4de39bee4c 100644 --- a/src/test/ui/issues/issue-41298.rs +++ b/src/test/ui/issues/issue-41298.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct Function { t: T, f: F } diff --git a/src/test/ui/issues/issue-41628.rs b/src/test/ui/issues/issue-41628.rs index 92369fdcd4910..92159824eb0e2 100644 --- a/src/test/ui/issues/issue-41628.rs +++ b/src/test/ui/issues/issue-41628.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(dead_code)] #[used] diff --git a/src/test/ui/issues/issue-41936-variance-coerce-unsized-cycle.rs b/src/test/ui/issues/issue-41936-variance-coerce-unsized-cycle.rs index 6c6cec25a9a49..3d678ba041b4e 100644 --- a/src/test/ui/issues/issue-41936-variance-coerce-unsized-cycle.rs +++ b/src/test/ui/issues/issue-41936-variance-coerce-unsized-cycle.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // Regression test for #41936. The coerce-unsized trait check in // coherence was using subtyping, which triggered variance diff --git a/src/test/ui/issues/issue-41998.rs b/src/test/ui/issues/issue-41998.rs index 2f2842598fc08..7696a3108d1da 100644 --- a/src/test/ui/issues/issue-41998.rs +++ b/src/test/ui/issues/issue-41998.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn main() { diff --git a/src/test/ui/issues/issue-42467.rs b/src/test/ui/issues/issue-42467.rs index f1a55169ffdfa..afa1bcd13fc82 100644 --- a/src/test/ui/issues/issue-42467.rs +++ b/src/test/ui/issues/issue-42467.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct Foo(T); diff --git a/src/test/ui/issues/issue-42956.rs b/src/test/ui/issues/issue-42956.rs index 8cf0ae0030693..e6b3f9ffab73c 100644 --- a/src/test/ui/issues/issue-42956.rs +++ b/src/test/ui/issues/issue-42956.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(stable_features)] #![feature(associated_consts)] diff --git a/src/test/ui/issues/issue-43057.rs b/src/test/ui/issues/issue-43057.rs index 7e1d5036f37f1..4ce52af434c0c 100644 --- a/src/test/ui/issues/issue-43057.rs +++ b/src/test/ui/issues/issue-43057.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused)] macro_rules! column { diff --git a/src/test/ui/issues/issue-43357.rs b/src/test/ui/issues/issue-43357.rs index 3090e229b6dcc..474c9765595b0 100644 --- a/src/test/ui/issues/issue-43357.rs +++ b/src/test/ui/issues/issue-43357.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] trait Trait { type Output; diff --git a/src/test/ui/issues/issue-43483.rs b/src/test/ui/issues/issue-43483.rs index f071d110f327e..76dd1c2eb5817 100644 --- a/src/test/ui/issues/issue-43483.rs +++ b/src/test/ui/issues/issue-43483.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(unused_variables)] trait VecN { diff --git a/src/test/ui/issues/issue-44247.rs b/src/test/ui/issues/issue-44247.rs index ef244e03857bf..3544880fade1c 100644 --- a/src/test/ui/issues/issue-44247.rs +++ b/src/test/ui/issues/issue-44247.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] trait T { type X; diff --git a/src/test/ui/issues/issue-44373-2.rs b/src/test/ui/issues/issue-44373-2.rs index 7fdc4b1ee5b54..194ce1dca7789 100644 --- a/src/test/ui/issues/issue-44373-2.rs +++ b/src/test/ui/issues/issue-44373-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] struct Foo(bool); diff --git a/src/test/ui/issues/issue-4464.rs b/src/test/ui/issues/issue-4464.rs index 13df61124829d..7ac107150a03b 100644 --- a/src/test/ui/issues/issue-4464.rs +++ b/src/test/ui/issues/issue-4464.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-44730.rs b/src/test/ui/issues/issue-44730.rs index 93f0445d3433e..0493811b279a7 100644 --- a/src/test/ui/issues/issue-44730.rs +++ b/src/test/ui/issues/issue-44730.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass //! dox #![deny(missing_docs)] diff --git a/src/test/ui/issues/issue-44851.rs b/src/test/ui/issues/issue-44851.rs index 735678047a539..23daaeb0f0088 100644 --- a/src/test/ui/issues/issue-44851.rs +++ b/src/test/ui/issues/issue-44851.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass macro_rules! a { () => { "a" } } diff --git a/src/test/ui/issues/issue-45425.rs b/src/test/ui/issues/issue-45425.rs index 99e018ba6c855..10ce374eadadd 100644 --- a/src/test/ui/issues/issue-45425.rs +++ b/src/test/ui/issues/issue-45425.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] use std::ops::Add; diff --git a/src/test/ui/issues/issue-46959.rs b/src/test/ui/issues/issue-46959.rs index 86f1158c1985e..3611a956836ce 100644 --- a/src/test/ui/issues/issue-46959.rs +++ b/src/test/ui/issues/issue-46959.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(non_camel_case_types)] #[allow(dead_code)] diff --git a/src/test/ui/issues/issue-46964.rs b/src/test/ui/issues/issue-46964.rs index 9cf53973d870a..28fa92f2091e7 100644 --- a/src/test/ui/issues/issue-46964.rs +++ b/src/test/ui/issues/issue-46964.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass mod my_mod { #[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash)] pub struct Name<'a> { diff --git a/src/test/ui/issues/issue-47094.rs b/src/test/ui/issues/issue-47094.rs index f17d4f88d9094..2be42daa8f2c9 100644 --- a/src/test/ui/issues/issue-47094.rs +++ b/src/test/ui/issues/issue-47094.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #[repr(C,u8)] enum Foo { diff --git a/src/test/ui/issues/issue-47673.rs b/src/test/ui/issues/issue-47673.rs index 0d813e2fad2c8..b5f0febfbeeac 100644 --- a/src/test/ui/issues/issue-47673.rs +++ b/src/test/ui/issues/issue-47673.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(unused_imports)] use {{}, {}}; diff --git a/src/test/ui/issues/issue-47703-1.rs b/src/test/ui/issues/issue-47703-1.rs index 95738828647f9..61d684c2a81b7 100644 --- a/src/test/ui/issues/issue-47703-1.rs +++ b/src/test/ui/issues/issue-47703-1.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct AtomicRefMut<'a> { value: &'a mut i32, diff --git a/src/test/ui/issues/issue-47703-tuple.rs b/src/test/ui/issues/issue-47703-tuple.rs index 1b285f219dcbc..bad187ead81d9 100644 --- a/src/test/ui/issues/issue-47703-tuple.rs +++ b/src/test/ui/issues/issue-47703-tuple.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct WithDrop; diff --git a/src/test/ui/issues/issue-47703.rs b/src/test/ui/issues/issue-47703.rs index dbf49c7621f67..38be6f5d2a986 100644 --- a/src/test/ui/issues/issue-47703.rs +++ b/src/test/ui/issues/issue-47703.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct MyStruct<'a> { field: &'a mut (), diff --git a/src/test/ui/issues/issue-47722.rs b/src/test/ui/issues/issue-47722.rs index b3c344257b6a2..5645a634343f6 100644 --- a/src/test/ui/issues/issue-47722.rs +++ b/src/test/ui/issues/issue-47722.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Tests that automatic coercions from &mut T to *mut T // allow borrows of T to expire immediately - essentially, that diff --git a/src/test/ui/issues/issue-47789.rs b/src/test/ui/issues/issue-47789.rs index 28671db09982f..32dd909b2e94a 100644 --- a/src/test/ui/issues/issue-47789.rs +++ b/src/test/ui/issues/issue-47789.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(non_upper_case_globals)] static mut x: &'static u32 = &0; diff --git a/src/test/ui/issues/issue-4830.rs b/src/test/ui/issues/issue-4830.rs index 3724bb6393ce6..a8553bd6bf3db 100644 --- a/src/test/ui/issues/issue-4830.rs +++ b/src/test/ui/issues/issue-4830.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-48551.rs b/src/test/ui/issues/issue-48551.rs index 903b2e2992963..b95a4832bb209 100644 --- a/src/test/ui/issues/issue-48551.rs +++ b/src/test/ui/issues/issue-48551.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Regression test for #48551. Covers a case where duplicate candidates // arose during associated type projection. diff --git a/src/test/ui/issues/issue-49556.rs b/src/test/ui/issues/issue-49556.rs index d3c6d17f416ae..c8c172f0e2f7f 100644 --- a/src/test/ui/issues/issue-49556.rs +++ b/src/test/ui/issues/issue-49556.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn iter<'a>(data: &'a [usize]) -> impl Iterator + 'a { data.iter() .map( diff --git a/src/test/ui/issues/issue-49579.rs b/src/test/ui/issues/issue-49579.rs index 767e06c4e90c5..98de014e90bea 100644 --- a/src/test/ui/issues/issue-49579.rs +++ b/src/test/ui/issues/issue-49579.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn fibs(n: u32) -> impl Iterator { (0 .. n) diff --git a/src/test/ui/issues/issue-50187.rs b/src/test/ui/issues/issue-50187.rs index f530c3853e38c..4b0aeaab4101f 100644 --- a/src/test/ui/issues/issue-50187.rs +++ b/src/test/ui/issues/issue-50187.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(decl_macro)] diff --git a/src/test/ui/issues/issue-50471.rs b/src/test/ui/issues/issue-50471.rs index e728e45e60bc2..7278c392d5456 100644 --- a/src/test/ui/issues/issue-50471.rs +++ b/src/test/ui/issues/issue-50471.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn main() { assert!({false}); diff --git a/src/test/ui/issues/issue-50518.rs b/src/test/ui/issues/issue-50518.rs index 653b52902d2b5..1e7b7794929ec 100644 --- a/src/test/ui/issues/issue-50518.rs +++ b/src/test/ui/issues/issue-50518.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::marker::PhantomData; struct Meta { diff --git a/src/test/ui/issues/issue-51655.rs b/src/test/ui/issues/issue-51655.rs index c2ad60fd8cfad..36fd90dabedc8 100644 --- a/src/test/ui/issues/issue-51655.rs +++ b/src/test/ui/issues/issue-51655.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] const PATH_DOT: &[u8] = &[b'.']; diff --git a/src/test/ui/issues/issue-52992.rs b/src/test/ui/issues/issue-52992.rs index 727dd43d57454..530d1a61b3176 100644 --- a/src/test/ui/issues/issue-52992.rs +++ b/src/test/ui/issues/issue-52992.rs @@ -2,7 +2,7 @@ // implied bounds was causing outlives relations that were not // properly handled. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn main() {} diff --git a/src/test/ui/issues/issue-53419.rs b/src/test/ui/issues/issue-53419.rs index 64ac0b1c03b97..892ec66afecf9 100644 --- a/src/test/ui/issues/issue-53419.rs +++ b/src/test/ui/issues/issue-53419.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct Foo { bar: dyn for<'r> Fn(usize, &'r dyn FnMut()) diff --git a/src/test/ui/issues/issue-5353.rs b/src/test/ui/issues/issue-5353.rs index cca17595051da..1d6813d5a39bd 100644 --- a/src/test/ui/issues/issue-5353.rs +++ b/src/test/ui/issues/issue-5353.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-53568.rs b/src/test/ui/issues/issue-53568.rs index 7644810c94757..49ae444f97e4b 100644 --- a/src/test/ui/issues/issue-53568.rs +++ b/src/test/ui/issues/issue-53568.rs @@ -1,7 +1,7 @@ // Regression test for an NLL-related ICE (#53568) -- we failed to // resolve inference variables in "custom type-ops". // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Future { type Item; diff --git a/src/test/ui/issues/issue-53675-a-test-called-panic.rs b/src/test/ui/issues/issue-53675-a-test-called-panic.rs index b8dca96946a41..e573038980d95 100644 --- a/src/test/ui/issues/issue-53675-a-test-called-panic.rs +++ b/src/test/ui/issues/issue-53675-a-test-called-panic.rs @@ -1,7 +1,7 @@ // rust-lang/rust#53675: At one point the compiler errored when a test // named `panic` used the `assert!` macro in expression position. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // compile-flags: --test mod in_expression_position { diff --git a/src/test/ui/issues/issue-54387.rs b/src/test/ui/issues/issue-54387.rs index 7aee500744d8e..60e3a02f4ce6c 100644 --- a/src/test/ui/issues/issue-54387.rs +++ b/src/test/ui/issues/issue-54387.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub struct GstRc { _obj: *const (), diff --git a/src/test/ui/issues/issue-54521-1.rs b/src/test/ui/issues/issue-54521-1.rs index 9bda7635effc2..8a682ef0a1162 100644 --- a/src/test/ui/issues/issue-54521-1.rs +++ b/src/test/ui/issues/issue-54521-1.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // This test checks that the `remove extra angle brackets` error doesn't happen for some // potential edge-cases.. diff --git a/src/test/ui/issues/issue-54943-1.rs b/src/test/ui/issues/issue-54943-1.rs index eca27819a409a..ec682d96081e3 100644 --- a/src/test/ui/issues/issue-54943-1.rs +++ b/src/test/ui/issues/issue-54943-1.rs @@ -1,7 +1,7 @@ // This test is a minimal version of an ICE in the dropck-eyepatch tests // found in the fix for #54943. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn foo(_t: T) { } diff --git a/src/test/ui/issues/issue-54943-2.rs b/src/test/ui/issues/issue-54943-2.rs index c32f85dbe1a8c..d400ae58db4a1 100644 --- a/src/test/ui/issues/issue-54943-2.rs +++ b/src/test/ui/issues/issue-54943-2.rs @@ -2,7 +2,7 @@ // found in the fix for #54943. In particular, this test is in unreachable // code as the initial fix for this ICE only worked if the code was reachable. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn foo(_t: T) { } diff --git a/src/test/ui/issues/issue-54943-3.rs b/src/test/ui/issues/issue-54943-3.rs index ef705946ad444..e6c2611b683e1 100644 --- a/src/test/ui/issues/issue-54943-3.rs +++ b/src/test/ui/issues/issue-54943-3.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // FIXME(#54943) This test targets the scenario where proving the WF requirements requires // knowing the value of the `_` type present in the user type annotation - unfortunately, figuring // out the value of that `_` requires type-checking the surrounding code, but that code is dead, diff --git a/src/test/ui/issues/issue-5500-1.rs b/src/test/ui/issues/issue-5500-1.rs index edbbe33c66fcc..98d6e1a14cb32 100644 --- a/src/test/ui/issues/issue-5500-1.rs +++ b/src/test/ui/issues/issue-5500-1.rs @@ -2,7 +2,7 @@ // is OK because the test is here to check that the compiler doesn't ICE (cf. // #5500). -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct TrieMapIterator<'a> { node: &'a usize diff --git a/src/test/ui/issues/issue-5572.rs b/src/test/ui/issues/issue-5572.rs index db26b0372a6cf..175dc879dda74 100644 --- a/src/test/ui/issues/issue-5572.rs +++ b/src/test/ui/issues/issue-5572.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-56128.rs b/src/test/ui/issues/issue-56128.rs index 32d87586cf4d2..10b50943c23a4 100644 --- a/src/test/ui/issues/issue-56128.rs +++ b/src/test/ui/issues/issue-56128.rs @@ -1,7 +1,7 @@ // Regression test for #56128. When this `pub(super) use...` gets // exploded in the HIR, we were not handling ids correctly. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass mod bar { pub(super) use self::baz::{x, y}; diff --git a/src/test/ui/issues/issue-56411-aux.rs b/src/test/ui/issues/issue-56411-aux.rs index 6880a8a98d25e..c8e5a059810a3 100644 --- a/src/test/ui/issues/issue-56411-aux.rs +++ b/src/test/ui/issues/issue-56411-aux.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct T {} diff --git a/src/test/ui/issues/issue-57156.rs b/src/test/ui/issues/issue-57156.rs index b6cd8c927a279..9f5ec9f27715c 100644 --- a/src/test/ui/issues/issue-57156.rs +++ b/src/test/ui/issues/issue-57156.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Foo { type Output; diff --git a/src/test/ui/issues/issue-57162.rs b/src/test/ui/issues/issue-57162.rs index 7ba2f9cea8410..6507006028721 100644 --- a/src/test/ui/issues/issue-57162.rs +++ b/src/test/ui/issues/issue-57162.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Foo {} impl Foo for dyn Send {} diff --git a/src/test/ui/issues/issue-57410-1.rs b/src/test/ui/issues/issue-57410-1.rs index c4247b3b11c2c..d825cb1800864 100644 --- a/src/test/ui/issues/issue-57410-1.rs +++ b/src/test/ui/issues/issue-57410-1.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Originally from #53925. // Tests that the `unreachable_pub` lint doesn't fire for `pub self::bar::Bar`. diff --git a/src/test/ui/issues/issue-57410.rs b/src/test/ui/issues/issue-57410.rs index de7ae4b3c0764..0cf4b8068e46b 100644 --- a/src/test/ui/issues/issue-57410.rs +++ b/src/test/ui/issues/issue-57410.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Tests that the `unreachable_pub` lint doesn't fire for `pub self::imp::f`. diff --git a/src/test/ui/issues/issue-5900.rs b/src/test/ui/issues/issue-5900.rs index 850e67db629c1..a7dc0eff43a23 100644 --- a/src/test/ui/issues/issue-5900.rs +++ b/src/test/ui/issues/issue-5900.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-5950.rs b/src/test/ui/issues/issue-5950.rs index 5c2250e25fc83..492a9d5723a88 100644 --- a/src/test/ui/issues/issue-5950.rs +++ b/src/test/ui/issues/issue-5950.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-60662.rs b/src/test/ui/issues/issue-60662.rs index dcf935c5780c5..967c5f8ed7313 100644 --- a/src/test/ui/issues/issue-60662.rs +++ b/src/test/ui/issues/issue-60662.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // compile-flags: -Z unpretty=hir #![feature(type_alias_impl_trait)] diff --git a/src/test/ui/issues/issue-60662.stdout b/src/test/ui/issues/issue-60662.stdout index e2a88dec97f7c..5a4b49cfa1e76 100644 --- a/src/test/ui/issues/issue-60662.stdout +++ b/src/test/ui/issues/issue-60662.stdout @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // compile-flags: -Z unpretty=hir #![feature(type_alias_impl_trait)] diff --git a/src/test/ui/issues/issue-6341.rs b/src/test/ui/issues/issue-6341.rs index 2fb0fee60bac5..1be1394dfae98 100644 --- a/src/test/ui/issues/issue-6341.rs +++ b/src/test/ui/issues/issue-6341.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 #[derive(PartialEq)] diff --git a/src/test/ui/issues/issue-6557.rs b/src/test/ui/issues/issue-6557.rs index 70b301d3d9cbb..e066aa52923b9 100644 --- a/src/test/ui/issues/issue-6557.rs +++ b/src/test/ui/issues/issue-6557.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-6898.rs b/src/test/ui/issues/issue-6898.rs index 6bf20d71d1f1e..44fd4bd07350d 100644 --- a/src/test/ui/issues/issue-6898.rs +++ b/src/test/ui/issues/issue-6898.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // pretty-expanded FIXME #23616 use std::mem; diff --git a/src/test/ui/issues/issue-6991.rs b/src/test/ui/issues/issue-6991.rs index aae67637f2cbf..f00cd9aeffd7c 100644 --- a/src/test/ui/issues/issue-6991.rs +++ b/src/test/ui/issues/issue-6991.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-7268.rs b/src/test/ui/issues/issue-7268.rs index 69901e97894c8..309176fb0c557 100644 --- a/src/test/ui/issues/issue-7268.rs +++ b/src/test/ui/issues/issue-7268.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-7607-2.rs b/src/test/ui/issues/issue-7607-2.rs index e336e0b47b283..420a0ffd3cc4b 100644 --- a/src/test/ui/issues/issue-7607-2.rs +++ b/src/test/ui/issues/issue-7607-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs index 9570386730a7b..2961dc79f10ef 100644 --- a/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs +++ b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs b/src/test/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs index 653d002fa61b5..505e7b84b5cd2 100644 --- a/src/test/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs +++ b/src/test/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-8398.rs b/src/test/ui/issues/issue-8398.rs index 5fe88854b39f4..0ef39b6a6b327 100644 --- a/src/test/ui/issues/issue-8398.rs +++ b/src/test/ui/issues/issue-8398.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-8521.rs b/src/test/ui/issues/issue-8521.rs index 02a0e14d55e62..15fbd4465a01a 100644 --- a/src/test/ui/issues/issue-8521.rs +++ b/src/test/ui/issues/issue-8521.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Foo1 {} trait A {} diff --git a/src/test/ui/issues/issue-8578.rs b/src/test/ui/issues/issue-8578.rs index 6ffb721372a4e..2346ef5a950d9 100644 --- a/src/test/ui/issues/issue-8578.rs +++ b/src/test/ui/issues/issue-8578.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] diff --git a/src/test/ui/issues/issue-9110.rs b/src/test/ui/issues/issue-9110.rs index f3bab42ee165f..cbf3c92d0332a 100644 --- a/src/test/ui/issues/issue-9110.rs +++ b/src/test/ui/issues/issue-9110.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 #![allow(non_snake_case)] diff --git a/src/test/ui/issues/issue-9249.rs b/src/test/ui/issues/issue-9249.rs index b1f2bd7569a96..caaba668ad7a6 100644 --- a/src/test/ui/issues/issue-9249.rs +++ b/src/test/ui/issues/issue-9249.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs b/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs index 7870d394c8bfb..e7614355455ae 100644 --- a/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs +++ b/src/test/ui/lint/issue-47390-unused-variable-in-struct-pattern.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(box_syntax)] #![feature(box_patterns)] diff --git a/src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs b/src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs index 47063a7c26786..ab9baa79b8b77 100644 --- a/src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs +++ b/src/test/ui/lint/issue-47775-nested-macro-unnecessary-parens-arg.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![warn(unused_parens)] diff --git a/src/test/ui/lint/issue-54099-camel-case-underscore-types.rs b/src/test/ui/lint/issue-54099-camel-case-underscore-types.rs index 3802e01a77556..b2bf87358a4d1 100644 --- a/src/test/ui/lint/issue-54099-camel-case-underscore-types.rs +++ b/src/test/ui/lint/issue-54099-camel-case-underscore-types.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![forbid(non_camel_case_types)] #![allow(dead_code)] diff --git a/src/test/ui/lint/unused_import_warning_issue_45268.rs b/src/test/ui/lint/unused_import_warning_issue_45268.rs index 68a5819c9c708..791bbb24196c8 100644 --- a/src/test/ui/lint/unused_import_warning_issue_45268.rs +++ b/src/test/ui/lint/unused_import_warning_issue_45268.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![warn(unused_imports)] // Warning explanation here, it's OK diff --git a/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs b/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs index 7679bf22e3cd4..a83ebc21f5f86 100644 --- a/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs +++ b/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Test that we propagate region relations from closures precisely when there is // more than one non-local lower bound. diff --git a/src/test/ui/nll/issue-16223.rs b/src/test/ui/nll/issue-16223.rs index c1205ba96ad69..0ae0ed3d87fc5 100644 --- a/src/test/ui/nll/issue-16223.rs +++ b/src/test/ui/nll/issue-16223.rs @@ -13,7 +13,7 @@ // | // = note: move occurs because the value has type `A`, which does not implement the `Copy` trait -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(box_patterns)] diff --git a/src/test/ui/nll/issue-21114-ebfull.rs b/src/test/ui/nll/issue-21114-ebfull.rs index 5a5db1a17f3f4..fc4a6845a4fa8 100644 --- a/src/test/ui/nll/issue-21114-ebfull.rs +++ b/src/test/ui/nll/issue-21114-ebfull.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::collections::HashMap; use std::sync::Mutex; diff --git a/src/test/ui/nll/issue-21114-kixunil.rs b/src/test/ui/nll/issue-21114-kixunil.rs index 32c97a651c50f..666f89f356d04 100644 --- a/src/test/ui/nll/issue-21114-kixunil.rs +++ b/src/test/ui/nll/issue-21114-kixunil.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn from_stdin(min: u64) -> Vec { use std::io::BufRead; diff --git a/src/test/ui/nll/issue-22323-temp-destruction.rs b/src/test/ui/nll/issue-22323-temp-destruction.rs index 1add91b1bd04a..3f2ece1cf6c91 100644 --- a/src/test/ui/nll/issue-22323-temp-destruction.rs +++ b/src/test/ui/nll/issue-22323-temp-destruction.rs @@ -1,7 +1,7 @@ // rust-lang/rust#22323: regression test demonstrating that NLL // precisely tracks temporary destruction order. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn main() { let _s = construct().borrow().consume_borrowed(); diff --git a/src/test/ui/nll/issue-30104.rs b/src/test/ui/nll/issue-30104.rs index 3f4818a28c8d6..38850cd3fdf1f 100644 --- a/src/test/ui/nll/issue-30104.rs +++ b/src/test/ui/nll/issue-30104.rs @@ -1,6 +1,6 @@ // Regression test for #30104 -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::ops::{Deref, DerefMut}; diff --git a/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs b/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs index bffff65015850..a8a8e69302675 100644 --- a/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs +++ b/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // rust-lang/rust#32382: Borrow checker used to complain about // `foobar_3` in the `impl` below, presumably due to some interaction diff --git a/src/test/ui/nll/issue-43058.rs b/src/test/ui/nll/issue-43058.rs index 8bf9028690fcd..227888d17d323 100644 --- a/src/test/ui/nll/issue-43058.rs +++ b/src/test/ui/nll/issue-43058.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::borrow::Cow; diff --git a/src/test/ui/nll/issue-47022.rs b/src/test/ui/nll/issue-47022.rs index ecd7071ecc783..521643c664de9 100644 --- a/src/test/ui/nll/issue-47022.rs +++ b/src/test/ui/nll/issue-47022.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct LoadedObject { bodies: Vec, diff --git a/src/test/ui/nll/issue-50716-1.rs b/src/test/ui/nll/issue-50716-1.rs index 1e602f27247d7..9c3e24de46eff 100644 --- a/src/test/ui/nll/issue-50716-1.rs +++ b/src/test/ui/nll/issue-50716-1.rs @@ -3,7 +3,7 @@ // bounds derived from `Sized` requirements” that checks that the fixed compiler // accepts this code fragment with both AST and MIR borrow checkers. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct Qey(Q); diff --git a/src/test/ui/nll/issue-51351.rs b/src/test/ui/nll/issue-51351.rs index efffe80aae45f..591d49584ee99 100644 --- a/src/test/ui/nll/issue-51351.rs +++ b/src/test/ui/nll/issue-51351.rs @@ -6,7 +6,7 @@ // of the closure, as they were not present in the closure's generic // declarations otherwise. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn creash<'a>() { let x: &'a () = &(); diff --git a/src/test/ui/nll/issue-52078.rs b/src/test/ui/nll/issue-52078.rs index 935bf8cda5e99..a2bcb91acf295 100644 --- a/src/test/ui/nll/issue-52078.rs +++ b/src/test/ui/nll/issue-52078.rs @@ -2,7 +2,7 @@ // between `'a` and `'b` below due to inference variables introduced // during the normalization process. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct Drain<'a, T: 'a> { _marker: ::std::marker::PhantomData<&'a T>, diff --git a/src/test/ui/nll/issue-53119.rs b/src/test/ui/nll/issue-53119.rs index f5400aaad8b45..03c9c071c9b10 100644 --- a/src/test/ui/nll/issue-53119.rs +++ b/src/test/ui/nll/issue-53119.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::ops::Deref; diff --git a/src/test/ui/nll/issue-53570.rs b/src/test/ui/nll/issue-53570.rs index 25c1929b227c8..35860ba9c21b5 100644 --- a/src/test/ui/nll/issue-53570.rs +++ b/src/test/ui/nll/issue-53570.rs @@ -6,7 +6,7 @@ // parameter `x` -- since `'b` cannot be expressed in the caller's // space, that got promoted th `'static`. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::cell::{RefCell, Ref}; diff --git a/src/test/ui/nll/issue-55344.rs b/src/test/ui/nll/issue-55344.rs index a65635585dbb6..20f18dc465d32 100644 --- a/src/test/ui/nll/issue-55344.rs +++ b/src/test/ui/nll/issue-55344.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(unused_mut)] diff --git a/src/test/ui/nll/issue-55651.rs b/src/test/ui/nll/issue-55651.rs index 73fce288f8bb6..46255bf74a138 100644 --- a/src/test/ui/nll/issue-55651.rs +++ b/src/test/ui/nll/issue-55651.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![feature(untagged_unions)] diff --git a/src/test/ui/nll/issue-57280-1.rs b/src/test/ui/nll/issue-57280-1.rs index f9cea42e7c4cc..b8979624e50e3 100644 --- a/src/test/ui/nll/issue-57280-1.rs +++ b/src/test/ui/nll/issue-57280-1.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Foo<'a> { const C: &'a u32; diff --git a/src/test/ui/nll/issue-57280.rs b/src/test/ui/nll/issue-57280.rs index 65ca23cc88f6c..b9d336ec395a2 100644 --- a/src/test/ui/nll/issue-57280.rs +++ b/src/test/ui/nll/issue-57280.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Foo { const BLAH: &'static str; diff --git a/src/test/ui/nll/issue-61311-normalize.rs b/src/test/ui/nll/issue-61311-normalize.rs index 9237c27f57ea8..77d67b07a40b3 100644 --- a/src/test/ui/nll/issue-61311-normalize.rs +++ b/src/test/ui/nll/issue-61311-normalize.rs @@ -1,7 +1,7 @@ // Regression test for #61311 // We would ICE after failing to normalize `Self::Proj` in the `impl` below. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub struct Unit; trait Obj {} diff --git a/src/test/ui/nll/issue-61320-normalize.rs b/src/test/ui/nll/issue-61320-normalize.rs index 59bceed08f909..095bef03f7cb9 100644 --- a/src/test/ui/nll/issue-61320-normalize.rs +++ b/src/test/ui/nll/issue-61320-normalize.rs @@ -1,7 +1,7 @@ // Regression test for #61320 // This is the same issue as #61311, just a larger test case. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass pub struct AndThen where diff --git a/src/test/ui/nll/relate_tys/issue-48071.rs b/src/test/ui/nll/relate_tys/issue-48071.rs index 36cd57a1b2d34..73361a0d31922 100644 --- a/src/test/ui/nll/relate_tys/issue-48071.rs +++ b/src/test/ui/nll/relate_tys/issue-48071.rs @@ -4,7 +4,7 @@ // placeholder region, but in NLL land it would fail because we had // rewritten `'static` to a region variable. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait Foo { fn foo(&self) { } diff --git a/src/test/ui/nll/ty-outlives/issue-53789-1.rs b/src/test/ui/nll/ty-outlives/issue-53789-1.rs index 2293d7d4bbc0d..a5201d4bbe83e 100644 --- a/src/test/ui/nll/ty-outlives/issue-53789-1.rs +++ b/src/test/ui/nll/ty-outlives/issue-53789-1.rs @@ -1,6 +1,6 @@ // Regression test for #53789. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::collections::BTreeMap; diff --git a/src/test/ui/nll/ty-outlives/issue-53789-2.rs b/src/test/ui/nll/ty-outlives/issue-53789-2.rs index 313b615fe8085..7dcdd58bb247e 100644 --- a/src/test/ui/nll/ty-outlives/issue-53789-2.rs +++ b/src/test/ui/nll/ty-outlives/issue-53789-2.rs @@ -1,6 +1,6 @@ // Regression test for #53789. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass use std::collections::BTreeMap; use std::ops::Range; diff --git a/src/test/ui/nll/ty-outlives/issue-55756.rs b/src/test/ui/nll/ty-outlives/issue-55756.rs index 147ea20348942..e1a3bc3c4ebc8 100644 --- a/src/test/ui/nll/ty-outlives/issue-55756.rs +++ b/src/test/ui/nll/ty-outlives/issue-55756.rs @@ -16,7 +16,7 @@ // Fixed by tweaking the solver to recognize that the constraint from // the environment duplicates one from the trait. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![crate_type="lib"] diff --git a/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs b/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs index 66b3110d2afd0..ff5b2244e4833 100644 --- a/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs +++ b/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // This test is reduced from a scenario pnkfelix encountered while // bootstrapping the compiler. diff --git a/src/test/ui/no-warn-on-field-replace-issue-34101.rs b/src/test/ui/no-warn-on-field-replace-issue-34101.rs index eb701b9184e6a..15df6d25c5da6 100644 --- a/src/test/ui/no-warn-on-field-replace-issue-34101.rs +++ b/src/test/ui/no-warn-on-field-replace-issue-34101.rs @@ -18,7 +18,7 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct Foo(String); diff --git a/src/test/ui/proc-macro/dollar-crate-issue-57089.rs b/src/test/ui/proc-macro/dollar-crate-issue-57089.rs index 2495e72751bb0..fb13bb064c708 100644 --- a/src/test/ui/proc-macro/dollar-crate-issue-57089.rs +++ b/src/test/ui/proc-macro/dollar-crate-issue-57089.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // edition:2018 // aux-build:test-macros.rs diff --git a/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs b/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs index ee9e7a364b8c7..bdd1ae91f7d76 100644 --- a/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs +++ b/src/test/ui/regions/issue-56537-closure-uses-region-from-container.rs @@ -8,7 +8,7 @@ // follow the same lifetime-elision rules used elsehwere. See // rust-lang/rust#56537 -// build-pass (FIXME(62277): could be check-pass?) +// check-pass fn willy_no_annot<'w>(p: &'w str, q: &str) -> &'w str { let free_dumb = |_x| { p }; // no type annotation at all diff --git a/src/test/ui/resolve/issue-57523.rs b/src/test/ui/resolve/issue-57523.rs index 5dc467d97e2be..976238cc3bd06 100644 --- a/src/test/ui/resolve/issue-57523.rs +++ b/src/test/ui/resolve/issue-57523.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass struct S(u8); diff --git a/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs b/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs index b662685ae2435..c712f15e32463 100644 --- a/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs +++ b/src/test/ui/rfc-2093-infer-outlives/issue-54467.rs @@ -6,7 +6,7 @@ // strange errors. This test ensures that we do not give compilation // errors. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass trait MyIterator<'a>: Iterator where Self::Item: 'a { } diff --git a/src/test/ui/rust-2018/uniform-paths/issue-56596-2.rs b/src/test/ui/rust-2018/uniform-paths/issue-56596-2.rs index 446b2d05717b0..9ea7e496d2b41 100644 --- a/src/test/ui/rust-2018/uniform-paths/issue-56596-2.rs +++ b/src/test/ui/rust-2018/uniform-paths/issue-56596-2.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // edition:2018 // compile-flags: --extern issue_56596_2 // aux-build:issue-56596-2.rs diff --git a/src/test/ui/span/issue-24690.rs b/src/test/ui/span/issue-24690.rs index f51ea55d4e6b8..2b7349c5503e1 100644 --- a/src/test/ui/span/issue-24690.rs +++ b/src/test/ui/span/issue-24690.rs @@ -1,7 +1,7 @@ //! A test to ensure that helpful `note` messages aren't emitted more often //! than necessary. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // Although there are three warnings, we should only get two "lint level defined // here" notes pointing at the `warnings` span, one for each error type. diff --git a/src/test/ui/traits/traits-issue-23003-overflow.rs b/src/test/ui/traits/traits-issue-23003-overflow.rs index 5538e0303ed12..c5f471f23c2e3 100644 --- a/src/test/ui/traits/traits-issue-23003-overflow.rs +++ b/src/test/ui/traits/traits-issue-23003-overflow.rs @@ -2,7 +2,7 @@ // types are required. This test now just compiles fine, since the // relevant rules that triggered the overflow were removed. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![allow(dead_code)] use std::marker::PhantomData; diff --git a/src/test/ui/type-alias-enum-variants/issue-57866.rs b/src/test/ui/type-alias-enum-variants/issue-57866.rs index 058b58e174c5a..5e105b20a8926 100644 --- a/src/test/ui/type-alias-enum-variants/issue-57866.rs +++ b/src/test/ui/type-alias-enum-variants/issue-57866.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass enum Outer { A(T) diff --git a/src/test/ui/type-alias-enum-variants/issue-61801-path-pattern-can-infer.rs b/src/test/ui/type-alias-enum-variants/issue-61801-path-pattern-can-infer.rs index bff04daed0d58..9c9eaab8da326 100644 --- a/src/test/ui/type-alias-enum-variants/issue-61801-path-pattern-can-infer.rs +++ b/src/test/ui/type-alias-enum-variants/issue-61801-path-pattern-can-infer.rs @@ -1,7 +1,7 @@ // In this regression test we check that a path pattern referring to a unit variant // through a type alias is successful in inferring the generic argument. -// build-pass (FIXME(62277): could be check-pass?) +// check-pass enum Opt { N, diff --git a/src/test/ui/typeck/issue-55810-must-typeck-match-pats-before-guards.rs b/src/test/ui/typeck/issue-55810-must-typeck-match-pats-before-guards.rs index 710b7c9bbeefc..23ea0ad61a7f7 100644 --- a/src/test/ui/typeck/issue-55810-must-typeck-match-pats-before-guards.rs +++ b/src/test/ui/typeck/issue-55810-must-typeck-match-pats-before-guards.rs @@ -1,4 +1,4 @@ -// build-pass (FIXME(62277): could be check-pass?) +// check-pass // rust-lang/rust#55810: types for a binding in a match arm can be // inferred from arms that come later in the match. From e8733f784558e5d8927d3d241b7cafa6e4843a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 4 Nov 2019 00:00:00 +0000 Subject: [PATCH 07/24] Add warning annotations for issue-47094 test --- src/test/ui/issues/issue-47094.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/ui/issues/issue-47094.rs b/src/test/ui/issues/issue-47094.rs index 2be42daa8f2c9..97da984d4afd0 100644 --- a/src/test/ui/issues/issue-47094.rs +++ b/src/test/ui/issues/issue-47094.rs @@ -1,12 +1,12 @@ // check-pass -#[repr(C,u8)] +#[repr(C,u8)] //~ WARNING conflicting representation hints enum Foo { A, B, } -#[repr(C)] +#[repr(C)] //~ WARNING conflicting representation hints #[repr(u8)] enum Bar { A, From f736de5dbcff9305a94fbebbb70d41638e572ce8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Wed, 6 Nov 2019 00:00:00 +0000 Subject: [PATCH 08/24] Apply review suggestions --- src/test/ui/issues/issue-14330.rs | 2 +- src/test/ui/issues/issue-17718-const-destructors.rs | 2 +- src/test/ui/issues/issue-29540.rs | 2 +- src/test/ui/issues/issue-3563-2.rs | 2 +- src/test/ui/issues/issue-37725.rs | 2 +- src/test/ui/issues/issue-3991.rs | 2 +- src/test/ui/privacy/issue-57264-1.rs | 2 +- src/test/ui/privacy/issue-57264-2.rs | 2 +- src/test/ui/suggestions/issue-57672.rs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/test/ui/issues/issue-14330.rs b/src/test/ui/issues/issue-14330.rs index 2b0be5edef4c9..0844fc72045e1 100644 --- a/src/test/ui/issues/issue-14330.rs +++ b/src/test/ui/issues/issue-14330.rs @@ -1,4 +1,4 @@ -// build-pass +// check-pass #![allow(unused_imports)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/issues/issue-17718-const-destructors.rs b/src/test/ui/issues/issue-17718-const-destructors.rs index 2e2fdab12cd41..c9a729c7b2071 100644 --- a/src/test/ui/issues/issue-17718-const-destructors.rs +++ b/src/test/ui/issues/issue-17718-const-destructors.rs @@ -1,4 +1,4 @@ -// build-pass +// check-pass #![allow(dead_code)] struct A; impl Drop for A { diff --git a/src/test/ui/issues/issue-29540.rs b/src/test/ui/issues/issue-29540.rs index 6871d3a501fe4..2a4d50f613cdc 100644 --- a/src/test/ui/issues/issue-29540.rs +++ b/src/test/ui/issues/issue-29540.rs @@ -1,4 +1,4 @@ -// check-pass +// build-pass #[derive(Debug)] pub struct Config { pub name: String, diff --git a/src/test/ui/issues/issue-3563-2.rs b/src/test/ui/issues/issue-3563-2.rs index 58fb839a71198..88a449b85b86a 100644 --- a/src/test/ui/issues/issue-3563-2.rs +++ b/src/test/ui/issues/issue-3563-2.rs @@ -1,4 +1,4 @@ -// build-pass +// check-pass // pretty-expanded FIXME #23616 trait Canvas { diff --git a/src/test/ui/issues/issue-37725.rs b/src/test/ui/issues/issue-37725.rs index dd917ce3df36f..965ecde6f3c04 100644 --- a/src/test/ui/issues/issue-37725.rs +++ b/src/test/ui/issues/issue-37725.rs @@ -1,4 +1,4 @@ -// check-pass +// build-pass #![allow(dead_code)] trait Foo { fn foo(&self); diff --git a/src/test/ui/issues/issue-3991.rs b/src/test/ui/issues/issue-3991.rs index 535b5675d6540..4851eddf53354 100644 --- a/src/test/ui/issues/issue-3991.rs +++ b/src/test/ui/issues/issue-3991.rs @@ -1,4 +1,4 @@ -// build-pass +// check-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/ui/privacy/issue-57264-1.rs b/src/test/ui/privacy/issue-57264-1.rs index 5de251148e3c5..59ebc4f54eedb 100644 --- a/src/test/ui/privacy/issue-57264-1.rs +++ b/src/test/ui/privacy/issue-57264-1.rs @@ -1,4 +1,4 @@ -// build-pass +// check-pass // aux-build:issue-57264-1.rs extern crate issue_57264_1; diff --git a/src/test/ui/privacy/issue-57264-2.rs b/src/test/ui/privacy/issue-57264-2.rs index 5cbb862fd9c2c..36ce5fd3b3e6f 100644 --- a/src/test/ui/privacy/issue-57264-2.rs +++ b/src/test/ui/privacy/issue-57264-2.rs @@ -1,4 +1,4 @@ -// build-pass +// check-pass // aux-build:issue-57264-2.rs extern crate issue_57264_2; diff --git a/src/test/ui/suggestions/issue-57672.rs b/src/test/ui/suggestions/issue-57672.rs index a469247182935..ee999d83ec2e0 100644 --- a/src/test/ui/suggestions/issue-57672.rs +++ b/src/test/ui/suggestions/issue-57672.rs @@ -1,6 +1,6 @@ // aux-build:foo.rs // compile-flags:--extern foo -// build-pass +// check-pass // edition:2018 #![deny(unused_extern_crates)] From 02f9167f94a06900ee555a5797081a44ebba009e Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Wed, 21 Aug 2019 19:56:46 +0200 Subject: [PATCH 09/24] Have tidy ensure that we document all `unsafe` blocks in libcore --- src/libcore/alloc.rs | 2 ++ src/libcore/any.rs | 6 ++++++ src/libcore/array/mod.rs | 2 ++ src/libcore/ascii.rs | 1 + src/libcore/benches/ascii.rs | 2 ++ src/libcore/cell.rs | 2 ++ src/libcore/char/convert.rs | 1 + src/libcore/char/decode.rs | 3 ++- src/libcore/char/methods.rs | 2 ++ src/libcore/ffi.rs | 1 + src/libcore/fmt/float.rs | 2 ++ src/libcore/fmt/mod.rs | 2 ++ src/libcore/fmt/num.rs | 2 ++ src/libcore/hash/mod.rs | 2 ++ src/libcore/hash/sip.rs | 2 ++ src/libcore/hint.rs | 2 ++ src/libcore/iter/adapters/mod.rs | 6 ++++++ src/libcore/iter/adapters/zip.rs | 2 ++ src/libcore/mem/maybe_uninit.rs | 2 ++ src/libcore/mem/mod.rs | 18 +++++++++++++++++- src/libcore/num/dec2flt/algorithm.rs | 4 ++++ src/libcore/num/f32.rs | 2 ++ src/libcore/num/f64.rs | 2 ++ src/libcore/num/mod.rs | 25 +++++++++++++++++++++++-- src/libcore/option.rs | 2 ++ src/libcore/panicking.rs | 2 ++ src/libcore/pin.rs | 2 ++ src/libcore/ptr/mod.rs | 2 ++ src/libcore/ptr/non_null.rs | 2 ++ src/libcore/ptr/unique.rs | 2 ++ src/libcore/slice/memchr.rs | 2 ++ src/libcore/slice/mod.rs | 1 + src/libcore/slice/sort.rs | 2 ++ src/libcore/str/lossy.rs | 2 ++ src/libcore/str/mod.rs | 1 + src/libcore/str/pattern.rs | 2 ++ src/libcore/sync/atomic.rs | 2 ++ src/libcore/tests/num/flt2dec/mod.rs | 2 ++ src/libcore/time.rs | 2 +- src/librustc_typeck/check/intrinsic.rs | 2 ++ src/tools/tidy/src/style.rs | 17 +++++++++++++++++ 41 files changed, 137 insertions(+), 5 deletions(-) diff --git a/src/libcore/alloc.rs b/src/libcore/alloc.rs index 5d0333d5226d2..1b06baeb711c2 100644 --- a/src/libcore/alloc.rs +++ b/src/libcore/alloc.rs @@ -1,5 +1,7 @@ //! Memory allocation APIs +// ignore-tidy-undocumented-unsafe + #![stable(feature = "alloc_module", since = "1.28.0")] use crate::cmp; diff --git a/src/libcore/any.rs b/src/libcore/any.rs index e2704e807d104..681f341b544e6 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -182,6 +182,7 @@ impl dyn Any { #[inline] pub fn downcast_ref(&self) -> Option<&T> { if self.is::() { + // SAFETY: just checked whether we are pointing to the correct type unsafe { Some(&*(self as *const dyn Any as *const T)) } @@ -217,6 +218,7 @@ impl dyn Any { #[inline] pub fn downcast_mut(&mut self) -> Option<&mut T> { if self.is::() { + // SAFETY: just checked whether we are pointing to the correct type unsafe { Some(&mut *(self as *mut dyn Any as *mut T)) } @@ -424,7 +426,11 @@ impl TypeId { #[rustc_const_unstable(feature="const_type_id")] pub const fn of() -> TypeId { TypeId { + #[cfg(boostrap_stdarch_ignore_this)] + // SAFETY: going away soon t: unsafe { intrinsics::type_id::() }, + #[cfg(not(boostrap_stdarch_ignore_this))] + t: intrinsics::type_id::(), } } } diff --git a/src/libcore/array/mod.rs b/src/libcore/array/mod.rs index e1ec8b795d04c..74a7d062d3f4a 100644 --- a/src/libcore/array/mod.rs +++ b/src/libcore/array/mod.rs @@ -156,6 +156,7 @@ where fn try_from(slice: &[T]) -> Result<&[T; N], TryFromSliceError> { if slice.len() == N { let ptr = slice.as_ptr() as *const [T; N]; + // SAFETY: ok because we just checked that the length fits unsafe { Ok(&*ptr) } } else { Err(TryFromSliceError(())) @@ -173,6 +174,7 @@ where fn try_from(slice: &mut [T]) -> Result<&mut [T; N], TryFromSliceError> { if slice.len() == N { let ptr = slice.as_mut_ptr() as *mut [T; N]; + // SAFETY: ok because we just checked that the length fits unsafe { Ok(&mut *ptr) } } else { Err(TryFromSliceError(())) diff --git a/src/libcore/ascii.rs b/src/libcore/ascii.rs index 4087333e2cf6d..9b588525bd698 100644 --- a/src/libcore/ascii.rs +++ b/src/libcore/ascii.rs @@ -135,6 +135,7 @@ impl FusedIterator for EscapeDefault {} #[stable(feature = "ascii_escape_display", since = "1.39.0")] impl fmt::Display for EscapeDefault { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + // SAFETY: ok because `escape_default` created only valid utf-8 data f.write_str(unsafe { from_utf8_unchecked(&self.data[self.range.clone()]) }) } } diff --git a/src/libcore/benches/ascii.rs b/src/libcore/benches/ascii.rs index a337c46713133..e921dd1ba0636 100644 --- a/src/libcore/benches/ascii.rs +++ b/src/libcore/benches/ascii.rs @@ -118,6 +118,7 @@ benches! { } fn case07_fake_simd_u32(bytes: &mut [u8]) { + // SAFETY: transmuting a sequence of `u8` to `u32` is always fine let (before, aligned, after) = unsafe { bytes.align_to_mut::() }; @@ -142,6 +143,7 @@ benches! { } fn case08_fake_simd_u64(bytes: &mut [u8]) { + // SAFETY: transmuting a sequence of `u8` to `u64` is always fine let (before, aligned, after) = unsafe { bytes.align_to_mut::() }; diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index fda103a52d8bc..31d7514133e1e 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -182,6 +182,8 @@ //! ``` //! +// ignore-tidy-undocumented-unsafe + #![stable(feature = "rust1", since = "1.0.0")] use crate::cmp::Ordering; diff --git a/src/libcore/char/convert.rs b/src/libcore/char/convert.rs index c456e14db12d4..28f5207449561 100644 --- a/src/libcore/char/convert.rs +++ b/src/libcore/char/convert.rs @@ -224,6 +224,7 @@ impl TryFrom for char { if (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF) { Err(CharTryFromError(())) } else { + // SAFETY: checked that it's a legal unicode value Ok(unsafe { from_u32_unchecked(i) }) } } diff --git a/src/libcore/char/decode.rs b/src/libcore/char/decode.rs index b71c9c2c40b37..ae09251c776de 100644 --- a/src/libcore/char/decode.rs +++ b/src/libcore/char/decode.rs @@ -87,7 +87,7 @@ impl> Iterator for DecodeUtf16 { }; if u < 0xD800 || 0xDFFF < u { - // not a surrogate + // SAFETY: not a surrogate Some(Ok(unsafe { from_u32_unchecked(u as u32) })) } else if u >= 0xDC00 { // a trailing surrogate @@ -107,6 +107,7 @@ impl> Iterator for DecodeUtf16 { // all ok, so lets decode it. let c = (((u - 0xD800) as u32) << 10 | (u2 - 0xDC00) as u32) + 0x1_0000; + // SAFETY: we checked that it's a legal unicode value Some(Ok(unsafe { from_u32_unchecked(c) })) } } diff --git a/src/libcore/char/methods.rs b/src/libcore/char/methods.rs index 971d89e004446..c048bab287dd2 100644 --- a/src/libcore/char/methods.rs +++ b/src/libcore/char/methods.rs @@ -438,6 +438,7 @@ impl char { #[inline] pub fn encode_utf8(self, dst: &mut [u8]) -> &mut str { let code = self as u32; + // SAFETY: each arm checks the size of the slice and only uses `get_unchecked` unsafe ops unsafe { let len = if code < MAX_ONE_B && !dst.is_empty() { *dst.get_unchecked_mut(0) = code as u8; @@ -507,6 +508,7 @@ impl char { #[inline] pub fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] { let mut code = self as u32; + // SAFETY: each arm checks whether there are enough bits to write into unsafe { if (code & 0xFFFF) == code && !dst.is_empty() { // The BMP falls through (assuming non-surrogate, as it should) diff --git a/src/libcore/ffi.rs b/src/libcore/ffi.rs index 569c667ac0a54..499dd0facd38c 100644 --- a/src/libcore/ffi.rs +++ b/src/libcore/ffi.rs @@ -315,6 +315,7 @@ impl<'f> Clone for VaListImpl<'f> { #[inline] fn clone(&self) -> Self { let mut dest = crate::mem::MaybeUninit::uninit(); + // SAFETY: we write to the `MaybeUninit`, thus it is initialized and `assume_init` is legal unsafe { va_copy(dest.as_mut_ptr(), self); dest.assume_init() diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs index a2fff913ac720..b52b56b1bdbc2 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -2,6 +2,8 @@ use crate::fmt::{Formatter, Result, LowerExp, UpperExp, Display, Debug}; use crate::mem::MaybeUninit; use crate::num::flt2dec; +// ignore-tidy-undocumented-unsafe + // Don't inline this so callers don't use the stack space this function // requires unless they have to. #[inline(never)] diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 0e83a282b18f7..5a039144f667f 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -1,5 +1,7 @@ //! Utilities for formatting and printing strings. +// ignore-tidy-undocumented-unsafe + #![stable(feature = "rust1", since = "1.0.0")] use crate::cell::{UnsafeCell, Cell, RefCell, Ref, RefMut}; diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 3b5c9fbff250a..3c7aefc090f8e 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -1,5 +1,7 @@ //! Integer and floating-point number formatting +// ignore-tidy-undocumented-unsafe + use crate::fmt; use crate::ops::{Div, Rem, Sub}; diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index 020e085abf8a8..0082363692df6 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -79,6 +79,8 @@ //! } //! ``` +// ignore-tidy-undocumented-unsafe + #![stable(feature = "rust1", since = "1.0.0")] use crate::fmt; diff --git a/src/libcore/hash/sip.rs b/src/libcore/hash/sip.rs index 19aeafd882ef1..194d9e6e2f8ad 100644 --- a/src/libcore/hash/sip.rs +++ b/src/libcore/hash/sip.rs @@ -1,5 +1,7 @@ //! An implementation of SipHash. +// ignore-tidy-undocumented-unsafe + #![allow(deprecated)] // the types in this module are deprecated use crate::marker::PhantomData; diff --git a/src/libcore/hint.rs b/src/libcore/hint.rs index 368a2f16b281e..f68a3e5a76fd7 100644 --- a/src/libcore/hint.rs +++ b/src/libcore/hint.rs @@ -2,6 +2,8 @@ //! Hints to compiler that affects how code should be emitted or optimized. +// ignore-tidy-undocumented-unsafe + use crate::intrinsics; /// Informs the compiler that this point in the code is not reachable, enabling diff --git a/src/libcore/iter/adapters/mod.rs b/src/libcore/iter/adapters/mod.rs index 3b8edc2ad6177..b016127a07a35 100644 --- a/src/libcore/iter/adapters/mod.rs +++ b/src/libcore/iter/adapters/mod.rs @@ -517,9 +517,15 @@ impl Iterator for StepBy where I: Iterator { // overflow handling loop { let mul = n.checked_mul(step); + #[cfg(boostrap_stdarch_ignore_this)] + // SAFETY: going away soon if unsafe { intrinsics::likely(mul.is_some()) } { return self.iter.nth(mul.unwrap() - 1); } + #[cfg(not(boostrap_stdarch_ignore_this))] + if intrinsics::likely(mul.is_some()) { + return self.iter.nth(mul.unwrap() - 1); + } let div_n = usize::MAX / n; let div_step = usize::MAX / step; let nth_n = div_n * n; diff --git a/src/libcore/iter/adapters/zip.rs b/src/libcore/iter/adapters/zip.rs index 430ceacdd9fab..14d9d5499b880 100644 --- a/src/libcore/iter/adapters/zip.rs +++ b/src/libcore/iter/adapters/zip.rs @@ -1,3 +1,5 @@ +// ignore-tidy-undocumented-unsafe + use crate::cmp; use super::super::{Iterator, DoubleEndedIterator, ExactSizeIterator, FusedIterator, TrustedLen}; diff --git a/src/libcore/mem/maybe_uninit.rs b/src/libcore/mem/maybe_uninit.rs index 51ba260589f62..9f2948dcb0310 100644 --- a/src/libcore/mem/maybe_uninit.rs +++ b/src/libcore/mem/maybe_uninit.rs @@ -1,6 +1,8 @@ use crate::intrinsics; use crate::mem::ManuallyDrop; +// ignore-tidy-undocumented-unsafe + /// A wrapper type to construct uninitialized instances of `T`. /// /// # Initialization invariant diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs index c7da56aad309a..7c504016c7562 100644 --- a/src/libcore/mem/mod.rs +++ b/src/libcore/mem/mod.rs @@ -93,6 +93,8 @@ pub fn forget(t: T) { #[inline] #[unstable(feature = "forget_unsized", issue = "0")] pub fn forget_unsized(t: T) { + // SAFETY: the forget intrinsic could be safe, but there's no point in making it safe since + // we'll be implementing this function soon via `ManuallyDrop` unsafe { intrinsics::forget(t) } } @@ -266,7 +268,11 @@ pub const fn size_of() -> usize { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn size_of_val(val: &T) -> usize { + #[cfg(boostrap_stdarch_ignore_this)] + // SAFETY: going away soon unsafe { intrinsics::size_of_val(val) } + #[cfg(not(boostrap_stdarch_ignore_this))] + intrinsics::size_of_val(val) } /// Returns the [ABI]-required minimum alignment of a type. @@ -310,7 +316,11 @@ pub fn min_align_of() -> usize { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(reason = "use `align_of_val` instead", since = "1.2.0")] pub fn min_align_of_val(val: &T) -> usize { + #[cfg(boostrap_stdarch_ignore_this)] + // SAFETY: going away soon unsafe { intrinsics::min_align_of_val(val) } + #[cfg(not(boostrap_stdarch_ignore_this))] + intrinsics::min_align_of_val(val) } /// Returns the [ABI]-required minimum alignment of a type. @@ -351,7 +361,7 @@ pub const fn align_of() -> usize { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn align_of_val(val: &T) -> usize { - unsafe { intrinsics::min_align_of_val(val) } + min_align_of_val(val) } /// Returns `true` if dropping values of type `T` matters. @@ -508,6 +518,8 @@ pub unsafe fn uninitialized() -> T { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn swap(x: &mut T, y: &mut T) { + // SAFETY: the raw pointers have been created from safe mutable references satisfying all the + // constraints on `ptr::swap_nonoverlapping_one` unsafe { ptr::swap_nonoverlapping_one(x, y); } @@ -822,7 +834,11 @@ impl fmt::Debug for Discriminant { /// ``` #[stable(feature = "discriminant_value", since = "1.21.0")] pub fn discriminant(v: &T) -> Discriminant { + #[cfg(boostrap_stdarch_ignore_this)] + // SAFETY: going away soon unsafe { Discriminant(intrinsics::discriminant_value(v), PhantomData) } + #[cfg(not(boostrap_stdarch_ignore_this))] + Discriminant(intrinsics::discriminant_value(v), PhantomData) } diff --git a/src/libcore/num/dec2flt/algorithm.rs b/src/libcore/num/dec2flt/algorithm.rs index ed89852dc48da..641463026261d 100644 --- a/src/libcore/num/dec2flt/algorithm.rs +++ b/src/libcore/num/dec2flt/algorithm.rs @@ -58,6 +58,8 @@ mod fpu_precision { pub struct FPUControlWord(u16); fn set_cw(cw: u16) { + // SAFETY: the `fldcw` instruction has been audited to be able to work correctly with + // any `u16` unsafe { asm!("fldcw $0" :: "m" (cw) :: "volatile") } } @@ -74,6 +76,8 @@ mod fpu_precision { // Get the original value of the control word to restore it later, when the // `FPUControlWord` structure is dropped + // SAFETY: the `fnstcw` instruction has been audited to be able to work correctly with + // any `u16` unsafe { asm!("fnstcw $0" : "=*m" (&cw) ::: "volatile") } // Set the control word to the desired precision. This is achieved by masking away the old diff --git a/src/libcore/num/f32.rs b/src/libcore/num/f32.rs index 5730088c4d9a9..7662bba6b5e13 100644 --- a/src/libcore/num/f32.rs +++ b/src/libcore/num/f32.rs @@ -414,6 +414,7 @@ impl f32 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn to_bits(self) -> u32 { + // SAFETY: `u32` is a plain old datatype so we can always transmute to it unsafe { mem::transmute(self) } } @@ -456,6 +457,7 @@ impl f32 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn from_bits(v: u32) -> Self { + // SAFETY: `u32` is a plain old datatype so we can always transmute from it // It turns out the safety issues with sNaN were overblown! Hooray! unsafe { mem::transmute(v) } } diff --git a/src/libcore/num/f64.rs b/src/libcore/num/f64.rs index 2bdeda340dce0..4a2a35dfb0999 100644 --- a/src/libcore/num/f64.rs +++ b/src/libcore/num/f64.rs @@ -427,6 +427,7 @@ impl f64 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn to_bits(self) -> u64 { + // SAFETY: `u64` is a plain old datatype so we can always transmute to it unsafe { mem::transmute(self) } } @@ -469,6 +470,7 @@ impl f64 { #[stable(feature = "float_bits_conv", since = "1.20.0")] #[inline] pub fn from_bits(v: u64) -> Self { + // SAFETY: `u64` is a plain old datatype so we can always transmute from it // It turns out the safety issues with sNaN were overblown! Hooray! unsafe { mem::transmute(v) } } diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index b4ade70414462..4b9e82c7cfee9 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -71,6 +71,7 @@ assert_eq!(size_of::>(), size_of::<", s #[inline] pub fn new(n: $Int) -> Option { if n != 0 { + // SAFETY: we just checked that there's no `0` Some(unsafe { $Ty(n) }) } else { None @@ -703,6 +704,7 @@ $EndFeature, " if rhs == 0 || (self == Self::min_value() && rhs == -1) { None } else { + // SAFETY: div by zero and by INT_MIN have been checked above Some(unsafe { intrinsics::unchecked_div(self, rhs) }) } } @@ -759,6 +761,7 @@ $EndFeature, " if rhs == 0 || (self == Self::min_value() && rhs == -1) { None } else { + // SAFETY: div by zero and by INT_MIN have been checked above Some(unsafe { intrinsics::unchecked_rem(self, rhs) }) } } @@ -1329,6 +1332,8 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_shl(self, rhs: u32) -> Self { + // SAFETY: the masking by the bitsize of the type ensures that we do not shift + // out of bounds unsafe { intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT) } @@ -1358,6 +1363,8 @@ $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_shr(self, rhs: u32) -> Self { + // SAFETY: the masking by the bitsize of the type ensures that we do not shift + // out of bounds unsafe { intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT) } @@ -2113,6 +2120,8 @@ assert_eq!( #[rustc_const_unstable(feature = "const_int_conversion")] #[inline] pub const fn to_ne_bytes(self) -> [u8; mem::size_of::()] { + // SAFETY: integers are plain old datatypes so we can always transmute them to + // arrays of bytes unsafe { mem::transmute(self) } } } @@ -2221,6 +2230,7 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), #[rustc_const_unstable(feature = "const_int_conversion")] #[inline] pub const fn from_ne_bytes(bytes: [u8; mem::size_of::()]) -> Self { + // SAFETY: integers are plain old datatypes so we can always transmute to them unsafe { mem::transmute(bytes) } } } @@ -2748,6 +2758,8 @@ assert_eq!(1", stringify!($SelfT), ".checked_div(0), None);", $EndFeature, " pub fn checked_div(self, rhs: Self) -> Option { match rhs { 0 => None, + // SAFETY: div by zero has been checked above and unsigned types have no other + // failure modes for division rhs => Some(unsafe { intrinsics::unchecked_div(self, rhs) }), } } @@ -2799,6 +2811,8 @@ assert_eq!(5", stringify!($SelfT), ".checked_rem(0), None);", $EndFeature, " if rhs == 0 { None } else { + // SAFETY: div by zero has been checked above and unsigned types have no other + // failure modes for division Some(unsafe { intrinsics::unchecked_rem(self, rhs) }) } } @@ -3248,6 +3262,8 @@ assert_eq!(1", stringify!($SelfT), ".wrapping_shl(128), 1);", $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_shl(self, rhs: u32) -> Self { + // SAFETY: the masking by the bitsize of the type ensures that we do not shift + // out of bounds unsafe { intrinsics::unchecked_shl(self, (rhs & ($BITS - 1)) as $SelfT) } @@ -3279,6 +3295,8 @@ assert_eq!(128", stringify!($SelfT), ".wrapping_shr(128), 128);", $EndFeature, " without modifying the original"] #[inline] pub const fn wrapping_shr(self, rhs: u32) -> Self { + // SAFETY: the masking by the bitsize of the type ensures that we do not shift + // out of bounds unsafe { intrinsics::unchecked_shr(self, (rhs & ($BITS - 1)) as $SelfT) } @@ -3775,11 +3793,11 @@ assert!(!10", stringify!($SelfT), ".is_power_of_two());", $EndFeature, " fn one_less_than_next_power_of_two(self) -> Self { if self <= 1 { return 0; } - // Because `p > 0`, it cannot consist entirely of leading zeros. + let p = self - 1; + // SAFETY: Because `p > 0`, it cannot consist entirely of leading zeros. // That means the shift is always in-bounds, and some processors // (such as intel pre-haswell) have more efficient ctlz // intrinsics when the argument is non-zero. - let p = self - 1; let z = unsafe { intrinsics::ctlz_nonzero(p) }; <$SelfT>::max_value() >> z } @@ -3925,6 +3943,8 @@ assert_eq!( #[rustc_const_unstable(feature = "const_int_conversion")] #[inline] pub const fn to_ne_bytes(self) -> [u8; mem::size_of::()] { + // SAFETY: integers are plain old datatypes so we can always transmute them to + // arrays of bytes unsafe { mem::transmute(self) } } } @@ -4033,6 +4053,7 @@ fn read_ne_", stringify!($SelfT), "(input: &mut &[u8]) -> ", stringify!($SelfT), #[rustc_const_unstable(feature = "const_int_conversion")] #[inline] pub const fn from_ne_bytes(bytes: [u8; mem::size_of::()]) -> Self { + // SAFETY: integers are plain old datatypes so we can always transmute to them unsafe { mem::transmute(bytes) } } } diff --git a/src/libcore/option.rs b/src/libcore/option.rs index f0ac5e749f6b3..958f31c0fd22a 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -133,6 +133,8 @@ //! [`Box`]: ../../std/boxed/struct.Box.html //! [`i32`]: ../../std/primitive.i32.html +// ignore-tidy-undocumented-unsafe + #![stable(feature = "rust1", since = "1.0.0")] use crate::iter::{FromIterator, FusedIterator, TrustedLen}; diff --git a/src/libcore/panicking.rs b/src/libcore/panicking.rs index 685b749776b1d..b88dc336097f3 100644 --- a/src/libcore/panicking.rs +++ b/src/libcore/panicking.rs @@ -20,6 +20,8 @@ //! one function. Currently, the actual symbol is declared in the standard //! library, but the location of this may change over time. +// ignore-tidy-undocumented-unsafe + #![allow(dead_code, missing_docs)] #![unstable(feature = "core_panic", reason = "internal details of the implementation of the `panic!` \ diff --git a/src/libcore/pin.rs b/src/libcore/pin.rs index be057ed6d59a7..1219fd09a9dfa 100644 --- a/src/libcore/pin.rs +++ b/src/libcore/pin.rs @@ -552,6 +552,7 @@ impl Pin

{ #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] pub fn as_ref(&self) -> Pin<&P::Target> { + // SAFETY: see documentation on this function unsafe { Pin::new_unchecked(&*self.pointer) } } @@ -610,6 +611,7 @@ impl Pin

{ #[stable(feature = "pin", since = "1.33.0")] #[inline(always)] pub fn as_mut(&mut self) -> Pin<&mut P::Target> { + // SAFETY: see documentation on this function unsafe { Pin::new_unchecked(&mut *self.pointer) } } diff --git a/src/libcore/ptr/mod.rs b/src/libcore/ptr/mod.rs index 1355ce1aa43b7..cb2fe7bc8bd58 100644 --- a/src/libcore/ptr/mod.rs +++ b/src/libcore/ptr/mod.rs @@ -61,6 +61,8 @@ //! [`write_volatile`]: ./fn.write_volatile.html //! [`NonNull::dangling`]: ./struct.NonNull.html#method.dangling +// ignore-tidy-undocumented-unsafe + #![stable(feature = "rust1", since = "1.0.0")] use crate::intrinsics; diff --git a/src/libcore/ptr/non_null.rs b/src/libcore/ptr/non_null.rs index 7dcd57f1f9858..7599991f0f15a 100644 --- a/src/libcore/ptr/non_null.rs +++ b/src/libcore/ptr/non_null.rs @@ -7,6 +7,8 @@ use crate::mem; use crate::ptr::Unique; use crate::cmp::Ordering; +// ignore-tidy-undocumented-unsafe + /// `*mut T` but non-zero and covariant. /// /// This is often the correct thing to use when building data structures using diff --git a/src/libcore/ptr/unique.rs b/src/libcore/ptr/unique.rs index 3521dd7997956..11a3aed1ab41b 100644 --- a/src/libcore/ptr/unique.rs +++ b/src/libcore/ptr/unique.rs @@ -5,6 +5,8 @@ use crate::marker::{PhantomData, Unsize}; use crate::mem; use crate::ptr::NonNull; +// ignore-tidy-undocumented-unsafe + /// A wrapper around a raw non-null `*mut T` that indicates that the possessor /// of this wrapper owns the referent. Useful for building abstractions like /// `Box`, `Vec`, `String`, and `HashMap`. diff --git a/src/libcore/slice/memchr.rs b/src/libcore/slice/memchr.rs index 45ab016c49628..2a2169dd348c2 100644 --- a/src/libcore/slice/memchr.rs +++ b/src/libcore/slice/memchr.rs @@ -1,6 +1,8 @@ // Original implementation taken from rust-memchr. // Copyright 2015 Andrew Gallant, bluss and Nicolas Koch +// ignore-tidy-undocumented-unsafe + use crate::cmp; use crate::mem; diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index cdada1252d2bf..88e367fe40c74 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -1,4 +1,5 @@ // ignore-tidy-filelength +// ignore-tidy-undocumented-unsafe //! Slice management and manipulation. //! diff --git a/src/libcore/slice/sort.rs b/src/libcore/slice/sort.rs index 2f2170f7ff14c..a719a51b61605 100644 --- a/src/libcore/slice/sort.rs +++ b/src/libcore/slice/sort.rs @@ -6,6 +6,8 @@ //! Unstable sorting is compatible with libcore because it doesn't allocate memory, unlike our //! stable sorting implementation. +// ignore-tidy-undocumented-unsafe + use crate::cmp; use crate::mem::{self, MaybeUninit}; use crate::ptr; diff --git a/src/libcore/str/lossy.rs b/src/libcore/str/lossy.rs index e8f747f1a67d5..762de0489a975 100644 --- a/src/libcore/str/lossy.rs +++ b/src/libcore/str/lossy.rs @@ -3,6 +3,8 @@ use crate::str as core_str; use crate::fmt::{self, Write}; use crate::mem; +// ignore-tidy-undocumented-unsafe + /// Lossy UTF-8 string. #[unstable(feature = "str_internals", issue = "0")] pub struct Utf8Lossy { diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 1968919f5541c..25b7eec5b3343 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -1,4 +1,5 @@ // ignore-tidy-filelength +// ignore-tidy-undocumented-unsafe //! String manipulation. //! diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs index ad9d956fda1c8..a494274118a74 100644 --- a/src/libcore/str/pattern.rs +++ b/src/libcore/str/pattern.rs @@ -3,6 +3,8 @@ //! For more details, see the traits [`Pattern`], [`Searcher`], //! [`ReverseSearcher`], and [`DoubleEndedSearcher`]. +// ignore-tidy-undocumented-unsafe + #![unstable(feature = "pattern", reason = "API not fully fleshed out and ready to be stabilized", issue = "27721")] diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 73d5abf1aed23..d311cb16b64d3 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -112,6 +112,8 @@ //! println!("live threads: {}", old_thread_count + 1); //! ``` +// ignore-tidy-undocumented-unsafe + #![stable(feature = "rust1", since = "1.0.0")] #![cfg_attr(not(target_has_atomic_load_store = "8"), allow(dead_code))] #![cfg_attr(not(target_has_atomic_load_store = "8"), allow(unused_imports))] diff --git a/src/libcore/tests/num/flt2dec/mod.rs b/src/libcore/tests/num/flt2dec/mod.rs index c41d35efced6c..a35897e9bc1ac 100644 --- a/src/libcore/tests/num/flt2dec/mod.rs +++ b/src/libcore/tests/num/flt2dec/mod.rs @@ -85,6 +85,8 @@ fn ldexp_f64(a: f64, b: i32) -> f64 { extern { fn ldexp(x: f64, n: i32) -> f64; } + // SAFETY: assuming a correct `ldexp` has been supplied, the given arguments cannot possibly + // cause undefined behavior unsafe { ldexp(a, b) } } diff --git a/src/libcore/time.rs b/src/libcore/time.rs index 5a0e4388e0325..57fc1a7b76075 100644 --- a/src/libcore/time.rs +++ b/src/libcore/time.rs @@ -920,7 +920,7 @@ impl fmt::Debug for Duration { if end == 0 { write!(f, "{}", integer_part) } else { - // We are only writing ASCII digits into the buffer and it was + // SAFETY: We are only writing ASCII digits into the buffer and it was // initialized with '0's, so it contains valid UTF8. let s = unsafe { crate::str::from_utf8_unchecked(&buf[..end]) diff --git a/src/librustc_typeck/check/intrinsic.rs b/src/librustc_typeck/check/intrinsic.rs index 33dc85fc68a2e..693f6f05fab28 100644 --- a/src/librustc_typeck/check/intrinsic.rs +++ b/src/librustc_typeck/check/intrinsic.rs @@ -67,11 +67,13 @@ fn equate_intrinsic_type<'tcx>( pub fn intrinsic_operation_unsafety(intrinsic: &str) -> hir::Unsafety { match intrinsic { "size_of" | "min_align_of" | "needs_drop" | "caller_location" | + "size_of_val" | "min_align_of_val" | "add_with_overflow" | "sub_with_overflow" | "mul_with_overflow" | "wrapping_add" | "wrapping_sub" | "wrapping_mul" | "saturating_add" | "saturating_sub" | "rotate_left" | "rotate_right" | "ctpop" | "ctlz" | "cttz" | "bswap" | "bitreverse" | + "discriminant_value" | "type_id" | "likely" | "unlikely" | "minnumf32" | "minnumf64" | "maxnumf32" | "maxnumf64" | "type_name" => hir::Unsafety::Normal, _ => hir::Unsafety::Unsafe, diff --git a/src/tools/tidy/src/style.rs b/src/tools/tidy/src/style.rs index 9302909968615..5abe481368df5 100644 --- a/src/tools/tidy/src/style.rs +++ b/src/tools/tidy/src/style.rs @@ -160,6 +160,8 @@ pub fn check(path: &Path, bad: &mut bool) { let can_contain = contents.contains("// ignore-tidy-") || contents.contains("# ignore-tidy-"); let mut skip_cr = contains_ignore_directive(can_contain, &contents, "cr"); + let mut skip_undocumented_unsafe = + contains_ignore_directive(can_contain, &contents, "undocumented-unsafe"); let mut skip_tab = contains_ignore_directive(can_contain, &contents, "tab"); let mut skip_line_length = contains_ignore_directive(can_contain, &contents, "linelength"); let mut skip_file_length = contains_ignore_directive(can_contain, &contents, "filelength"); @@ -171,6 +173,7 @@ pub fn check(path: &Path, bad: &mut bool) { let mut leading_new_lines = false; let mut trailing_new_lines = 0; let mut lines = 0; + let mut last_safety_comment = false; for (i, line) in contents.split('\n').enumerate() { let mut err = |msg: &str| { tidy_error!(bad, "{}:{}: {}", file.display(), i + 1, msg); @@ -200,6 +203,20 @@ pub fn check(path: &Path, bad: &mut bool) { err("XXX is deprecated; use FIXME") } } + let is_test = || file.components().any(|c| c.as_os_str() == "tests"); + // for now we just check libcore + if line.contains("unsafe {") && !line.trim().starts_with("//") && !last_safety_comment { + if file.components().any(|c| c.as_os_str() == "libcore") && !is_test() { + suppressible_tidy_err!(err, skip_undocumented_unsafe, "undocumented unsafe"); + } + } + if line.contains("// SAFETY: ") || line.contains("// Safety: ") { + last_safety_comment = true; + } else if line.trim().starts_with("//") || line.trim().is_empty() { + // keep previous value + } else { + last_safety_comment = false; + } if (line.starts_with("// Copyright") || line.starts_with("# Copyright") || line.starts_with("Copyright")) From 954fc719627cb608edee67cf2bf63547f7a31b05 Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sat, 19 Oct 2019 13:00:23 +0200 Subject: [PATCH 10/24] =?UTF-8?q?Halloween...=20time=20to=20get=20rid=20of?= =?UTF-8?q?=20=F0=9F=91=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/libcore/any.rs | 4 ++-- src/libcore/iter/adapters/mod.rs | 18 +++++++++++------- src/libcore/mem/mod.rs | 12 ++++++------ 3 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/libcore/any.rs b/src/libcore/any.rs index 681f341b544e6..39a5dd7263ccf 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -426,10 +426,10 @@ impl TypeId { #[rustc_const_unstable(feature="const_type_id")] pub const fn of() -> TypeId { TypeId { - #[cfg(boostrap_stdarch_ignore_this)] + #[cfg(bootstrap)] // SAFETY: going away soon t: unsafe { intrinsics::type_id::() }, - #[cfg(not(boostrap_stdarch_ignore_this))] + #[cfg(not(bootstrap))] t: intrinsics::type_id::(), } } diff --git a/src/libcore/iter/adapters/mod.rs b/src/libcore/iter/adapters/mod.rs index b016127a07a35..39d571006e66a 100644 --- a/src/libcore/iter/adapters/mod.rs +++ b/src/libcore/iter/adapters/mod.rs @@ -517,14 +517,18 @@ impl Iterator for StepBy where I: Iterator { // overflow handling loop { let mul = n.checked_mul(step); - #[cfg(boostrap_stdarch_ignore_this)] - // SAFETY: going away soon - if unsafe { intrinsics::likely(mul.is_some()) } { - return self.iter.nth(mul.unwrap() - 1); + #[cfg(bootstrap)] + { + // SAFETY: going away soon + if unsafe { intrinsics::likely(mul.is_some()) } { + return self.iter.nth(mul.unwrap() - 1); + } } - #[cfg(not(boostrap_stdarch_ignore_this))] - if intrinsics::likely(mul.is_some()) { - return self.iter.nth(mul.unwrap() - 1); + #[cfg(not(bootstrap))] + { + if intrinsics::likely(mul.is_some()) { + return self.iter.nth(mul.unwrap() - 1); + } } let div_n = usize::MAX / n; let div_step = usize::MAX / step; diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs index 7c504016c7562..8e6fb2536046f 100644 --- a/src/libcore/mem/mod.rs +++ b/src/libcore/mem/mod.rs @@ -268,10 +268,10 @@ pub const fn size_of() -> usize { #[inline] #[stable(feature = "rust1", since = "1.0.0")] pub fn size_of_val(val: &T) -> usize { - #[cfg(boostrap_stdarch_ignore_this)] + #[cfg(bootstrap)] // SAFETY: going away soon unsafe { intrinsics::size_of_val(val) } - #[cfg(not(boostrap_stdarch_ignore_this))] + #[cfg(not(bootstrap))] intrinsics::size_of_val(val) } @@ -316,10 +316,10 @@ pub fn min_align_of() -> usize { #[stable(feature = "rust1", since = "1.0.0")] #[rustc_deprecated(reason = "use `align_of_val` instead", since = "1.2.0")] pub fn min_align_of_val(val: &T) -> usize { - #[cfg(boostrap_stdarch_ignore_this)] + #[cfg(bootstrap)] // SAFETY: going away soon unsafe { intrinsics::min_align_of_val(val) } - #[cfg(not(boostrap_stdarch_ignore_this))] + #[cfg(not(bootstrap))] intrinsics::min_align_of_val(val) } @@ -834,11 +834,11 @@ impl fmt::Debug for Discriminant { /// ``` #[stable(feature = "discriminant_value", since = "1.21.0")] pub fn discriminant(v: &T) -> Discriminant { - #[cfg(boostrap_stdarch_ignore_this)] + #[cfg(bootstrap)] // SAFETY: going away soon unsafe { Discriminant(intrinsics::discriminant_value(v), PhantomData) } - #[cfg(not(boostrap_stdarch_ignore_this))] + #[cfg(not(bootstrap))] Discriminant(intrinsics::discriminant_value(v), PhantomData) } From 97633f814dd8b93aa026e72861208a8e21ccea5a Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Sat, 19 Oct 2019 13:02:17 +0200 Subject: [PATCH 11/24] Silence a deprecation warning --- src/libcore/mem/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcore/mem/mod.rs b/src/libcore/mem/mod.rs index 8e6fb2536046f..26909be949664 100644 --- a/src/libcore/mem/mod.rs +++ b/src/libcore/mem/mod.rs @@ -360,6 +360,7 @@ pub const fn align_of() -> usize { /// ``` #[inline] #[stable(feature = "rust1", since = "1.0.0")] +#[allow(deprecated)] pub fn align_of_val(val: &T) -> usize { min_align_of_val(val) } From 34f7fcb862c4c53bc281af8be2542887a965deee Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Fri, 25 Oct 2019 12:03:34 +0200 Subject: [PATCH 12/24] Rebase fallout --- src/librustc/ty/codec.rs | 3 ++ .../enum-discriminant/discriminant_value.rs | 45 +++++++++---------- src/test/ui/issues/issue-43398.rs | 8 ++-- src/test/ui/issues/issue-51582.rs | 2 +- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/librustc/ty/codec.rs b/src/librustc/ty/codec.rs index d5e7ac19263a0..b3ef3217ec6a0 100644 --- a/src/librustc/ty/codec.rs +++ b/src/librustc/ty/codec.rs @@ -76,7 +76,10 @@ pub fn encode_with_shorthand(encoder: &mut E, // The shorthand encoding uses the same usize as the // discriminant, with an offset so they can't conflict. + #[cfg(bootstrap)] let discriminant = unsafe { intrinsics::discriminant_value(variant) }; + #[cfg(not(bootstrap))] + let discriminant = intrinsics::discriminant_value(variant); assert!(discriminant < SHORTHAND_OFFSET as u64); let shorthand = start + SHORTHAND_OFFSET; diff --git a/src/test/ui/enum-discriminant/discriminant_value.rs b/src/test/ui/enum-discriminant/discriminant_value.rs index b7000015c71db..32d2d40241c82 100644 --- a/src/test/ui/enum-discriminant/discriminant_value.rs +++ b/src/test/ui/enum-discriminant/discriminant_value.rs @@ -51,34 +51,31 @@ enum Mixed { } pub fn main() { - unsafe { + assert_eq!(discriminant_value(&CLike1::A), 0); + assert_eq!(discriminant_value(&CLike1::B), 1); + assert_eq!(discriminant_value(&CLike1::C), 2); + assert_eq!(discriminant_value(&CLike1::D), 3); - assert_eq!(discriminant_value(&CLike1::A), 0); - assert_eq!(discriminant_value(&CLike1::B), 1); - assert_eq!(discriminant_value(&CLike1::C), 2); - assert_eq!(discriminant_value(&CLike1::D), 3); + assert_eq!(discriminant_value(&CLike2::A), 5); + assert_eq!(discriminant_value(&CLike2::B), 2); + assert_eq!(discriminant_value(&CLike2::C), 19); + assert_eq!(discriminant_value(&CLike2::D), 20); - assert_eq!(discriminant_value(&CLike2::A), 5); - assert_eq!(discriminant_value(&CLike2::B), 2); - assert_eq!(discriminant_value(&CLike2::C), 19); - assert_eq!(discriminant_value(&CLike2::D), 20); + assert_eq!(discriminant_value(&CLike3::A), 5); + assert_eq!(discriminant_value(&CLike3::B), 6); + assert_eq!(discriminant_value(&CLike3::C), -1_i8 as u64); + assert_eq!(discriminant_value(&CLike3::D), 0); - assert_eq!(discriminant_value(&CLike3::A), 5); - assert_eq!(discriminant_value(&CLike3::B), 6); - assert_eq!(discriminant_value(&CLike3::C), -1_i8 as u64); - assert_eq!(discriminant_value(&CLike3::D), 0); + assert_eq!(discriminant_value(&ADT::First(0,0)), 0); + assert_eq!(discriminant_value(&ADT::Second(5)), 1); - assert_eq!(discriminant_value(&ADT::First(0,0)), 0); - assert_eq!(discriminant_value(&ADT::Second(5)), 1); + assert_eq!(discriminant_value(&NullablePointer::Nothing), 1); + assert_eq!(discriminant_value(&NullablePointer::Something(&CONST)), 0); - assert_eq!(discriminant_value(&NullablePointer::Nothing), 1); - assert_eq!(discriminant_value(&NullablePointer::Something(&CONST)), 0); + assert_eq!(discriminant_value(&10), 0); + assert_eq!(discriminant_value(&"test"), 0); - assert_eq!(discriminant_value(&10), 0); - assert_eq!(discriminant_value(&"test"), 0); - - assert_eq!(3, discriminant_value(&Mixed::Unit)); - assert_eq!(2, discriminant_value(&Mixed::Tuple(5))); - assert_eq!(1, discriminant_value(&Mixed::Struct{a: 7, b: 11})); - } + assert_eq!(3, discriminant_value(&Mixed::Unit)); + assert_eq!(2, discriminant_value(&Mixed::Tuple(5))); + assert_eq!(1, discriminant_value(&Mixed::Struct{a: 7, b: 11})); } diff --git a/src/test/ui/issues/issue-43398.rs b/src/test/ui/issues/issue-43398.rs index ae52e8f3f6b43..f0b762c6254a3 100644 --- a/src/test/ui/issues/issue-43398.rs +++ b/src/test/ui/issues/issue-43398.rs @@ -7,9 +7,7 @@ enum Big { A, B } fn main() { - unsafe { - println!("{} {:?}", - std::intrinsics::discriminant_value(&Big::A), - std::mem::discriminant(&Big::B)); - } + println!("{} {:?}", + std::intrinsics::discriminant_value(&Big::A), + std::mem::discriminant(&Big::B)); } diff --git a/src/test/ui/issues/issue-51582.rs b/src/test/ui/issues/issue-51582.rs index 63ef05729bc56..40a70c623a741 100644 --- a/src/test/ui/issues/issue-51582.rs +++ b/src/test/ui/issues/issue-51582.rs @@ -14,5 +14,5 @@ fn main() { assert_eq!(1, make_b() as u8); assert_eq!(1, make_b() as i32); assert_eq!(1, make_b() as u32); - assert_eq!(1, unsafe { std::intrinsics::discriminant_value(&make_b()) }); + assert_eq!(1, std::intrinsics::discriminant_value(&make_b())); } From e28287b32c40c44fb120c9a3a7eae6f82a7031fa Mon Sep 17 00:00:00 2001 From: Oliver Scherer Date: Fri, 25 Oct 2019 18:35:51 +0200 Subject: [PATCH 13/24] The unsafety in `iter.rs` is already documented wonderfully --- src/libcore/array/iter.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libcore/array/iter.rs b/src/libcore/array/iter.rs index 11803238407c8..307e9b90ee2c0 100644 --- a/src/libcore/array/iter.rs +++ b/src/libcore/array/iter.rs @@ -51,7 +51,7 @@ where /// iterator (either via `IntoIterator` for arrays or via another way). #[unstable(feature = "array_value_iter", issue = "65798")] pub fn new(array: [T; N]) -> Self { - // The transmute here is actually safe. The docs of `MaybeUninit` + // SAFETY: The transmute here is actually safe. The docs of `MaybeUninit` // promise: // // > `MaybeUninit` is guaranteed to have the same size and alignment @@ -84,10 +84,10 @@ where /// Returns an immutable slice of all elements that have not been yielded /// yet. fn as_slice(&self) -> &[T] { - // This transmute is safe. As mentioned in `new`, `MaybeUninit` retains + let slice = &self.data[self.alive.clone()]; + // SAFETY: This transmute is safe. As mentioned in `new`, `MaybeUninit` retains // the size and alignment of `T`. Furthermore, we know that all // elements within `alive` are properly initialized. - let slice = &self.data[self.alive.clone()]; unsafe { mem::transmute::<&[MaybeUninit], &[T]>(slice) } @@ -117,7 +117,8 @@ where let idx = self.alive.start; self.alive.start += 1; - // Read the element from the array. This is safe: `idx` is an index + // Read the element from the array. + // SAFETY: This is safe: `idx` is an index // into the "alive" region of the array. Reading this element means // that `data[idx]` is regarded as dead now (i.e. do not touch). As // `idx` was the start of the alive-zone, the alive zone is now @@ -163,7 +164,8 @@ where // + 1]`. self.alive.end -= 1; - // Read the element from the array. This is safe: `alive.end` is an + // Read the element from the array. + // SAFETY: This is safe: `alive.end` is an // index into the "alive" region of the array. Compare the previous // comment that states that the alive region is // `data[alive.start..alive.end + 1]`. Reading this element means that @@ -226,6 +228,7 @@ where [T; N]: LengthAtMost32, { fn clone(&self) -> Self { + // SAFETY: each point of unsafety is documented inside the unsafe block unsafe { // This creates a new uninitialized array. Note that the `assume_init` // refers to the array, not the individual elements. And it is Ok if From e88db921486b1dff2d522573aa5c6c3544ea1929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Wed, 6 Nov 2019 00:00:00 +0000 Subject: [PATCH 14/24] Use -Zsave-analysis when compiling issue-37323.rs --- src/test/ui/issues/issue-37323.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/ui/issues/issue-37323.rs b/src/test/ui/issues/issue-37323.rs index aacb67ae177b2..55f5c5a9581b1 100644 --- a/src/test/ui/issues/issue-37323.rs +++ b/src/test/ui/issues/issue-37323.rs @@ -1,4 +1,5 @@ // check-pass +// compile-flags: -Zsave-analysis #![feature(rustc_attrs)] #![allow(warnings)] From a5be03654cf412299d1dffc6f83544a5e5efe416 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Thu, 7 Nov 2019 10:22:50 +0100 Subject: [PATCH 15/24] invalid_value lint: fix help text --- src/librustc_lint/builtin.rs | 3 +- src/test/ui/lint/uninitialized-zeroed.stderr | 70 ++++++++++---------- 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index 867f5f76b59bc..c6fd1256a8e64 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -2052,7 +2052,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for InvalidValue { ); err.span_label(expr.span, "this code causes undefined behavior when executed"); - err.span_label(expr.span, "help: use `MaybeUninit` instead"); + err.span_label(expr.span, "help: use `MaybeUninit` instead, \ + and only call `assume_init` after initialization is done"); if let Some(span) = span { err.span_note(span, &msg); } else { diff --git a/src/test/ui/lint/uninitialized-zeroed.stderr b/src/test/ui/lint/uninitialized-zeroed.stderr index e12b1897ade1b..bdb5959953f50 100644 --- a/src/test/ui/lint/uninitialized-zeroed.stderr +++ b/src/test/ui/lint/uninitialized-zeroed.stderr @@ -5,7 +5,7 @@ LL | let _val: &'static T = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: lint level defined here --> $DIR/uninitialized-zeroed.rs:7:9 @@ -21,7 +21,7 @@ LL | let _val: &'static T = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: References must be non-null @@ -32,7 +32,7 @@ LL | let _val: Wrap<&'static T> = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: References must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:18:18 @@ -47,7 +47,7 @@ LL | let _val: Wrap<&'static T> = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: References must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:18:18 @@ -62,7 +62,7 @@ LL | let _val: ! = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: The never type (`!`) has no valid value @@ -73,7 +73,7 @@ LL | let _val: ! = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: The never type (`!`) has no valid value @@ -84,7 +84,7 @@ LL | let _val: (i32, !) = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: The never type (`!`) has no valid value @@ -95,7 +95,7 @@ LL | let _val: (i32, !) = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: The never type (`!`) has no valid value @@ -106,7 +106,7 @@ LL | let _val: Void = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: 0-variant enums have no valid value @@ -117,7 +117,7 @@ LL | let _val: Void = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: 0-variant enums have no valid value @@ -128,7 +128,7 @@ LL | let _val: &'static i32 = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: References must be non-null @@ -139,7 +139,7 @@ LL | let _val: &'static i32 = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: References must be non-null @@ -150,7 +150,7 @@ LL | let _val: Ref = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: References must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:15:12 @@ -165,7 +165,7 @@ LL | let _val: Ref = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: References must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:15:12 @@ -180,7 +180,7 @@ LL | let _val: fn() = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: Function pointers must be non-null @@ -191,7 +191,7 @@ LL | let _val: fn() = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: Function pointers must be non-null @@ -202,7 +202,7 @@ LL | let _val: Wrap = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: Function pointers must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:18:18 @@ -217,7 +217,7 @@ LL | let _val: Wrap = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: Function pointers must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:18:18 @@ -232,7 +232,7 @@ LL | let _val: WrapEnum = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: Function pointers must be non-null (in this enum field) --> $DIR/uninitialized-zeroed.rs:19:28 @@ -247,7 +247,7 @@ LL | let _val: WrapEnum = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: Function pointers must be non-null (in this enum field) --> $DIR/uninitialized-zeroed.rs:19:28 @@ -262,7 +262,7 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: References must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:16:16 @@ -277,7 +277,7 @@ LL | let _val: Wrap<(RefPair, i32)> = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: References must be non-null (in this struct field) --> $DIR/uninitialized-zeroed.rs:16:16 @@ -292,7 +292,7 @@ LL | let _val: NonNull = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: std::ptr::NonNull must be non-null @@ -303,7 +303,7 @@ LL | let _val: NonNull = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: std::ptr::NonNull must be non-null @@ -314,7 +314,7 @@ LL | let _val: *const dyn Send = mem::zeroed(); | ^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: The vtable of a wide raw pointer must be non-null @@ -325,7 +325,7 @@ LL | let _val: *const dyn Send = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: The vtable of a wide raw pointer must be non-null @@ -336,7 +336,7 @@ LL | let _val: bool = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: Booleans must be `true` or `false` @@ -347,7 +347,7 @@ LL | let _val: Wrap = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | note: Characters must be a valid unicode codepoint (in this struct field) --> $DIR/uninitialized-zeroed.rs:18:18 @@ -362,7 +362,7 @@ LL | let _val: NonBig = mem::uninitialized(); | ^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: NonBig must be initialized inside its custom valid range @@ -373,7 +373,7 @@ LL | let _val: &'static i32 = mem::transmute(0usize); | ^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: References must be non-null @@ -384,7 +384,7 @@ LL | let _val: &'static [i32] = mem::transmute((0usize, 0usize)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: References must be non-null @@ -395,7 +395,7 @@ LL | let _val: NonZeroU32 = mem::transmute(0); | ^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: std::num::NonZeroU32 must be non-null @@ -406,7 +406,7 @@ LL | let _val: NonNull = MaybeUninit::zeroed().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: std::ptr::NonNull must be non-null @@ -417,7 +417,7 @@ LL | let _val: NonNull = MaybeUninit::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: std::ptr::NonNull must be non-null @@ -428,7 +428,7 @@ LL | let _val: bool = MaybeUninit::uninit().assume_init(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | | | this code causes undefined behavior when executed - | help: use `MaybeUninit` instead + | help: use `MaybeUninit` instead, and only call `assume_init` after initialization is done | = note: Booleans must be `true` or `false` From da116223c709392db3741d966cb49ea0407de19e Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 25 Oct 2019 04:57:40 +0200 Subject: [PATCH 16/24] move parse/parser.rs -> parse/parser/mod.rs --- src/libsyntax/parse/{parser.rs => parser/mod.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/libsyntax/parse/{parser.rs => parser/mod.rs} (100%) diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser/mod.rs similarity index 100% rename from src/libsyntax/parse/parser.rs rename to src/libsyntax/parse/parser/mod.rs From 8fa8e02c282f6dc4ebcd0f8403a881116a948443 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 12:29:23 +0200 Subject: [PATCH 17/24] syntax: simplify imports --- src/libsyntax/parse/lexer/comments.rs | 5 +++-- src/libsyntax/parse/parser/pat.rs | 2 +- src/libsyntax/parse/tests.rs | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index ac79ce323bf97..33415bdcb62e7 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -1,9 +1,10 @@ pub use CommentStyle::*; +use super::is_block_doc_comment; + use crate::ast; use crate::source_map::SourceMap; -use crate::parse::lexer::is_block_doc_comment; -use crate::parse::lexer::ParseSess; +use crate::sess::ParseSess; use syntax_pos::{BytePos, CharPos, Pos, FileName}; diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs index cc8738edff7f5..fcb7c4d132306 100644 --- a/src/libsyntax/parse/parser/pat.rs +++ b/src/libsyntax/parse/parser/pat.rs @@ -5,7 +5,7 @@ use crate::ptr::P; use crate::ast::{self, Attribute, Pat, PatKind, FieldPat, RangeEnd, RangeSyntax, Mac}; use crate::ast::{BindingMode, Ident, Mutability, Path, QSelf, Expr, ExprKind}; use crate::mut_visit::{noop_visit_pat, noop_visit_mac, MutVisitor}; -use crate::parse::token::{self}; +use crate::parse::token; use crate::print::pprust; use crate::source_map::{respan, Span, Spanned}; use crate::ThinVec; diff --git a/src/libsyntax/parse/tests.rs b/src/libsyntax/parse/tests.rs index 169eb954efadf..201eaca947bc2 100644 --- a/src/libsyntax/parse/tests.rs +++ b/src/libsyntax/parse/tests.rs @@ -2,8 +2,8 @@ use super::*; use crate::ast::{self, Name, PatKind}; use crate::attr::first_attr_value_str_by_name; -use crate::parse::{ParseSess, PResult}; -use crate::parse::new_parser_from_source_str; +use crate::sess::ParseSess; +use crate::parse::{PResult, new_parser_from_source_str}; use crate::parse::token::Token; use crate::print::pprust::item_to_string; use crate::ptr::P; From 53a50d4e4fdb0b242d637142d0b2d64e7054c35b Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 12:32:18 +0200 Subject: [PATCH 18/24] move unescape_error_reporting to lexer/ --- src/libsyntax/parse/lexer/mod.rs | 3 ++- src/libsyntax/parse/{ => lexer}/unescape_error_reporting.rs | 0 src/libsyntax/parse/mod.rs | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) rename src/libsyntax/parse/{ => lexer}/unescape_error_reporting.rs (100%) diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index e2a7ea28b9b59..a6dfed542d6a6 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1,7 +1,6 @@ use crate::parse::token::{self, Token, TokenKind}; use crate::sess::ParseSess; use crate::symbol::{sym, Symbol}; -use crate::parse::unescape_error_reporting::{emit_unescape_error, push_escaped_char}; use errors::{FatalError, DiagnosticBuilder}; use syntax_pos::{BytePos, Pos, Span}; @@ -19,6 +18,8 @@ mod tests; pub mod comments; mod tokentrees; mod unicode_chars; +mod unescape_error_reporting; +use unescape_error_reporting::{emit_unescape_error, push_escaped_char}; #[derive(Clone, Debug)] pub struct UnmatchedBrace { diff --git a/src/libsyntax/parse/unescape_error_reporting.rs b/src/libsyntax/parse/lexer/unescape_error_reporting.rs similarity index 100% rename from src/libsyntax/parse/unescape_error_reporting.rs rename to src/libsyntax/parse/lexer/unescape_error_reporting.rs diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index b688dce87c138..5b020d3d28853 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -29,7 +29,6 @@ pub mod token; crate mod classify; crate mod literal; -crate mod unescape_error_reporting; pub type PResult<'a, T> = Result>; From 9d6768a478b8a6afa1e16dfebe9d79bd3f508cdf Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 12:46:32 +0200 Subject: [PATCH 19/24] syntax::parser::token -> syntax::token --- src/librustc/hir/lowering.rs | 2 +- src/librustc/hir/map/def_collector.rs | 2 +- src/librustc/ich/impls_syntax.rs | 4 ++-- src/librustc_interface/interface.rs | 2 +- src/librustc_resolve/build_reduced_graph.rs | 2 +- src/librustc_save_analysis/dump_visitor.rs | 2 +- src/librustc_save_analysis/span_utils.rs | 2 +- src/librustdoc/html/highlight.rs | 2 +- src/librustdoc/passes/check_code_block_syntax.rs | 2 +- src/libsyntax/ast.rs | 2 +- src/libsyntax/attr/mod.rs | 2 +- src/libsyntax/feature_gate/check.rs | 2 +- src/libsyntax/lib.rs | 1 + src/libsyntax/mut_visit.rs | 2 +- src/libsyntax/parse/lexer/mod.rs | 2 +- src/libsyntax/parse/lexer/tests.rs | 2 +- src/libsyntax/parse/lexer/tokentrees.rs | 2 +- src/libsyntax/parse/lexer/unicode_chars.rs | 2 +- src/libsyntax/parse/literal.rs | 2 +- src/libsyntax/parse/mod.rs | 3 +-- src/libsyntax/parse/parser/attr.rs | 2 +- src/libsyntax/parse/parser/diagnostics.rs | 2 +- src/libsyntax/parse/parser/expr.rs | 2 +- src/libsyntax/parse/parser/generics.rs | 2 +- src/libsyntax/parse/parser/mod.rs | 2 +- src/libsyntax/parse/parser/module.rs | 2 +- src/libsyntax/parse/parser/pat.rs | 2 +- src/libsyntax/parse/parser/path.rs | 2 +- src/libsyntax/parse/parser/stmt.rs | 2 +- src/libsyntax/parse/parser/ty.rs | 2 +- src/libsyntax/parse/tests.rs | 2 +- src/libsyntax/print/pprust.rs | 2 +- src/libsyntax/{parse => }/token.rs | 0 src/libsyntax/tokenstream.rs | 2 +- src/libsyntax/util/parser.rs | 2 +- src/libsyntax/visit.rs | 2 +- src/libsyntax_expand/base.rs | 2 +- src/libsyntax_expand/expand.rs | 2 +- src/libsyntax_expand/mbe.rs | 2 +- src/libsyntax_expand/mbe/macro_check.rs | 2 +- src/libsyntax_expand/mbe/macro_parser.rs | 2 +- src/libsyntax_expand/mbe/macro_rules.rs | 3 +-- src/libsyntax_expand/mbe/quoted.rs | 2 +- src/libsyntax_expand/mbe/transcribe.rs | 2 +- src/libsyntax_expand/proc_macro.rs | 3 ++- src/libsyntax_expand/proc_macro_server.rs | 7 ++++--- src/libsyntax_ext/asm.rs | 2 +- src/libsyntax_ext/assert.rs | 2 +- src/libsyntax_ext/cfg.rs | 2 +- src/libsyntax_ext/cmdline_attrs.rs | 3 ++- src/libsyntax_ext/concat_idents.rs | 2 +- src/libsyntax_ext/format.rs | 2 +- src/libsyntax_ext/global_asm.rs | 2 +- src/libsyntax_ext/plugin_macro_defs.rs | 4 ++-- src/libsyntax_ext/source_util.rs | 3 ++- src/test/ui-fulldeps/ast_stmt_expr_attr.rs | 2 +- src/test/ui-fulldeps/auxiliary/roman-numerals.rs | 2 +- 57 files changed, 64 insertions(+), 61 deletions(-) rename src/libsyntax/{parse => }/token.rs (100%) diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index 6344c7a233ca4..87ad4ace59238 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -66,7 +66,7 @@ use syntax::ptr::P as AstP; use syntax::ast::*; use syntax::errors; use syntax::print::pprust; -use syntax::parse::token::{self, Nonterminal, Token}; +use syntax::token::{self, Nonterminal, Token}; use syntax::tokenstream::{TokenStream, TokenTree}; use syntax::sess::ParseSess; use syntax::source_map::{respan, ExpnData, ExpnKind, DesugaringKind, Spanned}; diff --git a/src/librustc/hir/map/def_collector.rs b/src/librustc/hir/map/def_collector.rs index e9970e30bf9e5..57c1421bde6cd 100644 --- a/src/librustc/hir/map/def_collector.rs +++ b/src/librustc/hir/map/def_collector.rs @@ -4,7 +4,7 @@ use crate::hir::def_id::DefIndex; use syntax::ast::*; use syntax::visit; use syntax::symbol::{kw, sym}; -use syntax::parse::token::{self, Token}; +use syntax::token::{self, Token}; use syntax_pos::hygiene::ExpnId; use syntax_pos::Span; diff --git a/src/librustc/ich/impls_syntax.rs b/src/librustc/ich/impls_syntax.rs index 2201c4b0980b3..c401bd17dd417 100644 --- a/src/librustc/ich/impls_syntax.rs +++ b/src/librustc/ich/impls_syntax.rs @@ -8,9 +8,9 @@ use std::mem; use syntax::ast; use syntax::feature_gate; -use syntax::parse::token; -use syntax::symbol::SymbolStr; +use syntax::token; use syntax::tokenstream; +use syntax_pos::symbol::SymbolStr; use syntax_pos::SourceFile; use crate::hir::def_id::{DefId, CrateNum, CRATE_DEF_INDEX}; diff --git a/src/librustc_interface/interface.rs b/src/librustc_interface/interface.rs index 4e4d6d982fbc5..034e861b2123c 100644 --- a/src/librustc_interface/interface.rs +++ b/src/librustc_interface/interface.rs @@ -16,7 +16,7 @@ use std::result; use std::sync::{Arc, Mutex}; use syntax::{self, parse}; use syntax::ast::{self, MetaItemKind}; -use syntax::parse::token; +use syntax::token; use syntax::source_map::{FileName, FileLoader, SourceMap}; use syntax::sess::ParseSess; use syntax_pos::edition; diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index 55f054d0be323..4239518b879e3 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -33,7 +33,7 @@ use syntax::attr; use syntax::ast::{self, Block, ForeignItem, ForeignItemKind, Item, ItemKind, NodeId}; use syntax::ast::{MetaItemKind, StmtKind, TraitItem, TraitItemKind}; use syntax::feature_gate::is_builtin_attr; -use syntax::parse::token::{self, Token}; +use syntax::token::{self, Token}; use syntax::print::pprust; use syntax::{span_err, struct_span_err}; use syntax::source_map::{respan, Spanned}; diff --git a/src/librustc_save_analysis/dump_visitor.rs b/src/librustc_save_analysis/dump_visitor.rs index a372106d3795b..5c5fbcc07de4c 100644 --- a/src/librustc_save_analysis/dump_visitor.rs +++ b/src/librustc_save_analysis/dump_visitor.rs @@ -24,7 +24,7 @@ use std::path::Path; use std::env; use syntax::ast::{self, Attribute, NodeId, PatKind}; -use syntax::parse::token; +use syntax::token; use syntax::visit::{self, Visitor}; use syntax::print::pprust::{ bounds_to_string, diff --git a/src/librustc_save_analysis/span_utils.rs b/src/librustc_save_analysis/span_utils.rs index fb9919d777db1..4d0780cf94df0 100644 --- a/src/librustc_save_analysis/span_utils.rs +++ b/src/librustc_save_analysis/span_utils.rs @@ -3,7 +3,7 @@ use rustc::session::Session; use crate::generated_code; use syntax::parse::lexer::{self, StringReader}; -use syntax::parse::token::{self, TokenKind}; +use syntax::token::{self, TokenKind}; use syntax_pos::*; #[derive(Clone)] diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 88ba13f2796a0..4bd72f7e61ccc 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -13,7 +13,7 @@ use std::io::prelude::*; use syntax::source_map::SourceMap; use syntax::parse::lexer; -use syntax::parse::token::{self, Token}; +use syntax::token::{self, Token}; use syntax::sess::ParseSess; use syntax::symbol::{kw, sym}; use syntax_pos::{Span, FileName}; diff --git a/src/librustdoc/passes/check_code_block_syntax.rs b/src/librustdoc/passes/check_code_block_syntax.rs index 10e15ab8881af..4603e77b0fda8 100644 --- a/src/librustdoc/passes/check_code_block_syntax.rs +++ b/src/librustdoc/passes/check_code_block_syntax.rs @@ -1,6 +1,6 @@ use errors::Applicability; use syntax::parse::lexer::{StringReader as Lexer}; -use syntax::parse::token; +use syntax::token; use syntax::sess::ParseSess; use syntax::source_map::FilePathMapping; use syntax_pos::{InnerSpan, FileName}; diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 67d1acbccfbe5..18151a1586c93 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -24,9 +24,9 @@ pub use crate::util::parser::ExprPrecedence; pub use syntax_pos::symbol::{Ident, Symbol as Name}; -use crate::parse::token::{self, DelimToken}; use crate::ptr::P; use crate::source_map::{dummy_spanned, respan, Spanned}; +use crate::token::{self, DelimToken}; use crate::tokenstream::TokenStream; use syntax_pos::symbol::{kw, sym, Symbol}; diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index c663995eb8fcb..1534d2723c877 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -17,7 +17,7 @@ use crate::source_map::{BytePos, Spanned}; use crate::parse::lexer::comments::doc_comment_style; use crate::parse; use crate::parse::PResult; -use crate::parse::token::{self, Token}; +use crate::token::{self, Token}; use crate::ptr::P; use crate::sess::ParseSess; use crate::symbol::{sym, Symbol}; diff --git a/src/libsyntax/feature_gate/check.rs b/src/libsyntax/feature_gate/check.rs index 5b1493ebc9b01..ecff89ad59bd9 100644 --- a/src/libsyntax/feature_gate/check.rs +++ b/src/libsyntax/feature_gate/check.rs @@ -11,7 +11,7 @@ use crate::attr::{self, check_builtin_attribute}; use crate::source_map::Spanned; use crate::edition::{ALL_EDITIONS, Edition}; use crate::visit::{self, FnKind, Visitor}; -use crate::parse::token; +use crate::token; use crate::sess::ParseSess; use crate::symbol::{Symbol, sym}; use crate::tokenstream::TokenTree; diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 7be6e6c7e1876..4c134430f30e6 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -107,6 +107,7 @@ pub mod show_span; pub use syntax_pos::edition; pub use syntax_pos::symbol; pub mod sess; +pub mod token; pub mod tokenstream; pub mod visit; diff --git a/src/libsyntax/mut_visit.rs b/src/libsyntax/mut_visit.rs index 7261601e14491..0c90652526d80 100644 --- a/src/libsyntax/mut_visit.rs +++ b/src/libsyntax/mut_visit.rs @@ -9,7 +9,7 @@ use crate::ast::*; use crate::source_map::{Spanned, respan}; -use crate::parse::token::{self, Token}; +use crate::token::{self, Token}; use crate::ptr::P; use crate::ThinVec; use crate::tokenstream::*; diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index a6dfed542d6a6..5499a3cae5f73 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1,4 +1,4 @@ -use crate::parse::token::{self, Token, TokenKind}; +use crate::token::{self, Token, TokenKind}; use crate::sess::ParseSess; use crate::symbol::{sym, Symbol}; diff --git a/src/libsyntax/parse/lexer/tests.rs b/src/libsyntax/parse/lexer/tests.rs index de301b1fc499d..b9b82b2bcefa7 100644 --- a/src/libsyntax/parse/lexer/tests.rs +++ b/src/libsyntax/parse/lexer/tests.rs @@ -2,7 +2,7 @@ use super::*; use crate::symbol::Symbol; use crate::source_map::{SourceMap, FilePathMapping}; -use crate::parse::token; +use crate::token; use crate::with_default_globals; use errors::{Handler, emitter::EmitterWriter}; diff --git a/src/libsyntax/parse/lexer/tokentrees.rs b/src/libsyntax/parse/lexer/tokentrees.rs index de8ac2c71e818..3c15a5e1daeda 100644 --- a/src/libsyntax/parse/lexer/tokentrees.rs +++ b/src/libsyntax/parse/lexer/tokentrees.rs @@ -4,8 +4,8 @@ use syntax_pos::Span; use super::{StringReader, UnmatchedBrace}; use crate::print::pprust::token_to_string; -use crate::parse::token::{self, Token}; use crate::parse::PResult; +use crate::token::{self, Token}; use crate::tokenstream::{DelimSpan, IsJoint::{self, *}, TokenStream, TokenTree, TreeAndJoint}; impl<'a> StringReader<'a> { diff --git a/src/libsyntax/parse/lexer/unicode_chars.rs b/src/libsyntax/parse/lexer/unicode_chars.rs index 525b4215affb1..6eb995b61d3fe 100644 --- a/src/libsyntax/parse/lexer/unicode_chars.rs +++ b/src/libsyntax/parse/lexer/unicode_chars.rs @@ -4,7 +4,7 @@ use super::StringReader; use errors::{Applicability, DiagnosticBuilder}; use syntax_pos::{BytePos, Pos, Span, symbol::kw}; -use crate::parse::token; +use crate::token; #[rustfmt::skip] // for line breaks const UNICODE_ARRAY: &[(char, &str, char)] = &[ diff --git a/src/libsyntax/parse/literal.rs b/src/libsyntax/parse/literal.rs index a8eeac59954f1..d4c9b7850c5c9 100644 --- a/src/libsyntax/parse/literal.rs +++ b/src/libsyntax/parse/literal.rs @@ -1,8 +1,8 @@ //! Code related to parsing literals. use crate::ast::{self, Lit, LitKind}; -use crate::parse::token::{self, Token}; use crate::symbol::{kw, sym, Symbol}; +use crate::token::{self, Token}; use crate::tokenstream::TokenTree; use log::debug; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 5b020d3d28853..7db0ca0b78d3d 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -2,7 +2,7 @@ use crate::ast; use crate::parse::parser::{Parser, emit_unclosed_delims, make_unclosed_delims_error}; -use crate::parse::token::Nonterminal; +use crate::token::{self, Nonterminal}; use crate::tokenstream::{self, TokenStream, TokenTree}; use crate::print::pprust; use crate::sess::ParseSess; @@ -25,7 +25,6 @@ mod tests; #[macro_use] pub mod parser; pub mod lexer; -pub mod token; crate mod classify; crate mod literal; diff --git a/src/libsyntax/parse/parser/attr.rs b/src/libsyntax/parse/parser/attr.rs index 1c292661f2440..aa0542a09a925 100644 --- a/src/libsyntax/parse/parser/attr.rs +++ b/src/libsyntax/parse/parser/attr.rs @@ -1,7 +1,7 @@ use super::{SeqSep, PResult, Parser, TokenType, PathStyle}; use crate::attr; use crate::ast; -use crate::parse::token::{self, Nonterminal, DelimToken}; +use crate::token::{self, Nonterminal, DelimToken}; use crate::tokenstream::{TokenStream, TokenTree}; use crate::source_map::Span; diff --git a/src/libsyntax/parse/parser/diagnostics.rs b/src/libsyntax/parse/parser/diagnostics.rs index 49a517a5c44da..09f0b9b74b2eb 100644 --- a/src/libsyntax/parse/parser/diagnostics.rs +++ b/src/libsyntax/parse/parser/diagnostics.rs @@ -6,7 +6,7 @@ use crate::ast::{ self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item, ItemKind, Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind, }; -use crate::parse::token::{self, TokenKind, token_can_begin_expr}; +use crate::token::{self, TokenKind, token_can_begin_expr}; use crate::print::pprust; use crate::ptr::P; use crate::symbol::{kw, sym}; diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index 509e6482dcc06..4b962201e8556 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -12,7 +12,7 @@ use crate::ast::{ }; use crate::maybe_recover_from_interpolated_ty_qpath; use crate::parse::classify; -use crate::parse::token::{self, Token, TokenKind}; +use crate::token::{self, Token, TokenKind}; use crate::print::pprust; use crate::ptr::P; use crate::source_map::{self, Span}; diff --git a/src/libsyntax/parse/parser/generics.rs b/src/libsyntax/parse/parser/generics.rs index 3c094750b4d98..cfc3768cac543 100644 --- a/src/libsyntax/parse/parser/generics.rs +++ b/src/libsyntax/parse/parser/generics.rs @@ -1,7 +1,7 @@ use super::{Parser, PResult}; use crate::ast::{self, WhereClause, GenericParam, GenericParamKind, GenericBounds, Attribute}; -use crate::parse::token; +use crate::token; use crate::source_map::DUMMY_SP; use syntax_pos::symbol::{kw, sym}; diff --git a/src/libsyntax/parse/parser/mod.rs b/src/libsyntax/parse/parser/mod.rs index 1284e89f195c7..6498b674a3b7d 100644 --- a/src/libsyntax/parse/parser/mod.rs +++ b/src/libsyntax/parse/parser/mod.rs @@ -18,7 +18,7 @@ use crate::ast::{ use crate::parse::{PResult, Directory, DirectoryOwnership}; use crate::parse::lexer::UnmatchedBrace; use crate::parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; -use crate::parse::token::{self, Token, TokenKind, DelimToken}; +use crate::token::{self, Token, TokenKind, DelimToken}; use crate::print::pprust; use crate::ptr::P; use crate::sess::ParseSess; diff --git a/src/libsyntax/parse/parser/module.rs b/src/libsyntax/parse/parser/module.rs index 242a17659a06b..70e0dfc3e8808 100644 --- a/src/libsyntax/parse/parser/module.rs +++ b/src/libsyntax/parse/parser/module.rs @@ -5,7 +5,7 @@ use super::diagnostics::Error; use crate::attr; use crate::ast::{self, Ident, Attribute, ItemKind, Mod, Crate}; use crate::parse::{new_sub_parser_from_file, DirectoryOwnership}; -use crate::parse::token::{self, TokenKind}; +use crate::token::{self, TokenKind}; use crate::source_map::{SourceMap, Span, DUMMY_SP, FileName}; use crate::symbol::sym; diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs index fcb7c4d132306..c4a983188faff 100644 --- a/src/libsyntax/parse/parser/pat.rs +++ b/src/libsyntax/parse/parser/pat.rs @@ -5,7 +5,7 @@ use crate::ptr::P; use crate::ast::{self, Attribute, Pat, PatKind, FieldPat, RangeEnd, RangeSyntax, Mac}; use crate::ast::{BindingMode, Ident, Mutability, Path, QSelf, Expr, ExprKind}; use crate::mut_visit::{noop_visit_pat, noop_visit_mac, MutVisitor}; -use crate::parse::token; +use crate::token; use crate::print::pprust; use crate::source_map::{respan, Span, Spanned}; use crate::ThinVec; diff --git a/src/libsyntax/parse/parser/path.rs b/src/libsyntax/parse/parser/path.rs index 4438d61d9eedd..2659e0c680e3f 100644 --- a/src/libsyntax/parse/parser/path.rs +++ b/src/libsyntax/parse/parser/path.rs @@ -3,7 +3,7 @@ use super::{Parser, PResult, TokenType}; use crate::{maybe_whole, ThinVec}; use crate::ast::{self, QSelf, Path, PathSegment, Ident, ParenthesizedArgs, AngleBracketedArgs}; use crate::ast::{AnonConst, GenericArg, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode}; -use crate::parse::token::{self, Token}; +use crate::token::{self, Token}; use crate::source_map::{Span, BytePos}; use syntax_pos::symbol::{kw, sym}; diff --git a/src/libsyntax/parse/parser/stmt.rs b/src/libsyntax/parse/parser/stmt.rs index 12c530f3cbba0..010fd9c37fd71 100644 --- a/src/libsyntax/parse/parser/stmt.rs +++ b/src/libsyntax/parse/parser/stmt.rs @@ -9,7 +9,7 @@ use crate::{maybe_whole, ThinVec}; use crate::ast::{self, DUMMY_NODE_ID, Stmt, StmtKind, Local, Block, BlockCheckMode, Expr, ExprKind}; use crate::ast::{Attribute, AttrStyle, VisibilityKind, MacStmtStyle, Mac, MacDelimiter}; use crate::parse::{classify, DirectoryOwnership}; -use crate::parse::token; +use crate::token; use crate::source_map::{respan, Span}; use crate::symbol::{kw, sym}; diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs index b770b90705cbe..4183416e628cc 100644 --- a/src/libsyntax/parse/parser/ty.rs +++ b/src/libsyntax/parse/parser/ty.rs @@ -6,7 +6,7 @@ use crate::ptr::P; use crate::ast::{self, Ty, TyKind, MutTy, BareFnTy, FunctionRetTy, GenericParam, Lifetime, Ident}; use crate::ast::{TraitBoundModifier, TraitObjectSyntax, GenericBound, GenericBounds, PolyTraitRef}; use crate::ast::{Mutability, AnonConst, Mac}; -use crate::parse::token::{self, Token}; +use crate::token::{self, Token}; use crate::source_map::Span; use crate::symbol::{kw}; diff --git a/src/libsyntax/parse/tests.rs b/src/libsyntax/parse/tests.rs index 201eaca947bc2..27ca2b6472f0c 100644 --- a/src/libsyntax/parse/tests.rs +++ b/src/libsyntax/parse/tests.rs @@ -4,7 +4,7 @@ use crate::ast::{self, Name, PatKind}; use crate::attr::first_attr_value_str_by_name; use crate::sess::ParseSess; use crate::parse::{PResult, new_parser_from_source_str}; -use crate::parse::token::Token; +use crate::token::Token; use crate::print::pprust::item_to_string; use crate::ptr::P; use crate::source_map::FilePathMapping; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 1d59c13a9d081..049f34efc262c 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -4,7 +4,7 @@ use crate::ast::{Attribute, MacDelimiter, GenericArg}; use crate::util::parser::{self, AssocOp, Fixity}; use crate::attr; use crate::source_map::{self, SourceMap, Spanned}; -use crate::parse::token::{self, BinOpToken, DelimToken, Nonterminal, Token, TokenKind}; +use crate::token::{self, BinOpToken, DelimToken, Nonterminal, Token, TokenKind}; use crate::parse::lexer::comments; use crate::parse; use crate::print::pp::{self, Breaks}; diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/token.rs similarity index 100% rename from src/libsyntax/parse/token.rs rename to src/libsyntax/token.rs diff --git a/src/libsyntax/tokenstream.rs b/src/libsyntax/tokenstream.rs index a51d208704ade..6e1bb85ce1ac1 100644 --- a/src/libsyntax/tokenstream.rs +++ b/src/libsyntax/tokenstream.rs @@ -13,7 +13,7 @@ //! and a borrowed `TokenStream` is sufficient to build an owned `TokenStream` without taking //! ownership of the original. -use crate::parse::token::{self, DelimToken, Token, TokenKind}; +use crate::token::{self, DelimToken, Token, TokenKind}; use syntax_pos::{Span, DUMMY_SP}; #[cfg(target_arch = "x86_64")] diff --git a/src/libsyntax/util/parser.rs b/src/libsyntax/util/parser.rs index 982755e868054..edb708d7e97b2 100644 --- a/src/libsyntax/util/parser.rs +++ b/src/libsyntax/util/parser.rs @@ -1,4 +1,4 @@ -use crate::parse::token::{self, Token, BinOpToken}; +use crate::token::{self, Token, BinOpToken}; use crate::symbol::kw; use crate::ast::{self, BinOpKind}; diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs index 117787d08c750..cfd160fd57751 100644 --- a/src/libsyntax/visit.rs +++ b/src/libsyntax/visit.rs @@ -14,7 +14,7 @@ //! those that are created by the expansion of a macro. use crate::ast::*; -use crate::parse::token::Token; +use crate::token::Token; use crate::tokenstream::{TokenTree, TokenStream}; use syntax_pos::Span; diff --git a/src/libsyntax_expand/base.rs b/src/libsyntax_expand/base.rs index d02251eb746d0..47835c9265967 100644 --- a/src/libsyntax_expand/base.rs +++ b/src/libsyntax_expand/base.rs @@ -6,11 +6,11 @@ use syntax::source_map::SourceMap; use syntax::edition::Edition; use syntax::mut_visit::{self, MutVisitor}; use syntax::parse::{self, parser, DirectoryOwnership}; -use syntax::parse::token; use syntax::ptr::P; use syntax::sess::ParseSess; use syntax::symbol::{kw, sym, Ident, Symbol}; use syntax::{ThinVec, MACRO_ARGUMENTS}; +use syntax::token; use syntax::tokenstream::{self, TokenStream}; use syntax::visit::Visitor; diff --git a/src/libsyntax_expand/expand.rs b/src/libsyntax_expand/expand.rs index 7dbc778701006..6d1f0abe49eaf 100644 --- a/src/libsyntax_expand/expand.rs +++ b/src/libsyntax_expand/expand.rs @@ -13,12 +13,12 @@ use syntax::config::StripUnconfigured; use syntax::feature_gate::{self, Features, GateIssue, is_builtin_attr, emit_feature_err}; use syntax::mut_visit::*; use syntax::parse::{DirectoryOwnership, PResult}; -use syntax::parse::token; use syntax::parse::parser::Parser; use syntax::print::pprust; use syntax::ptr::P; use syntax::sess::ParseSess; use syntax::symbol::{sym, Symbol}; +use syntax::token; use syntax::tokenstream::{TokenStream, TokenTree}; use syntax::visit::{self, Visitor}; use syntax::util::map_in_place::MapInPlace; diff --git a/src/libsyntax_expand/mbe.rs b/src/libsyntax_expand/mbe.rs index 06e0cde3ad88c..6964d01b719c9 100644 --- a/src/libsyntax_expand/mbe.rs +++ b/src/libsyntax_expand/mbe.rs @@ -10,7 +10,7 @@ crate mod macro_rules; crate mod quoted; use syntax::ast; -use syntax::parse::token::{self, Token, TokenKind}; +use syntax::token::{self, Token, TokenKind}; use syntax::tokenstream::{DelimSpan}; use syntax_pos::Span; diff --git a/src/libsyntax_expand/mbe/macro_check.rs b/src/libsyntax_expand/mbe/macro_check.rs index 50abda8d45e97..25754ed42177f 100644 --- a/src/libsyntax_expand/mbe/macro_check.rs +++ b/src/libsyntax_expand/mbe/macro_check.rs @@ -108,7 +108,7 @@ use crate::mbe::{KleeneToken, TokenTree}; use syntax::ast::NodeId; use syntax::early_buffered_lints::BufferedEarlyLintId; -use syntax::parse::token::{DelimToken, Token, TokenKind}; +use syntax::token::{DelimToken, Token, TokenKind}; use syntax::sess::ParseSess; use syntax::symbol::{kw, sym}; diff --git a/src/libsyntax_expand/mbe/macro_parser.rs b/src/libsyntax_expand/mbe/macro_parser.rs index 3efe22626a9fa..950e7c0f286fa 100644 --- a/src/libsyntax_expand/mbe/macro_parser.rs +++ b/src/libsyntax_expand/mbe/macro_parser.rs @@ -79,10 +79,10 @@ use crate::mbe::{self, TokenTree}; use syntax::ast::{Ident, Name}; use syntax::parse::{Directory, PResult}; use syntax::parse::parser::{Parser, PathStyle}; -use syntax::parse::token::{self, DocComment, Nonterminal, Token}; use syntax::print::pprust; use syntax::sess::ParseSess; use syntax::symbol::{kw, sym, Symbol}; +use syntax::token::{self, DocComment, Nonterminal, Token}; use syntax::tokenstream::{DelimSpan, TokenStream}; use errors::FatalError; diff --git a/src/libsyntax_expand/mbe/macro_rules.rs b/src/libsyntax_expand/mbe/macro_rules.rs index 5571990740317..a5fc301fbf67b 100644 --- a/src/libsyntax_expand/mbe/macro_rules.rs +++ b/src/libsyntax_expand/mbe/macro_rules.rs @@ -13,12 +13,11 @@ use syntax::attr::{self, TransparencyError}; use syntax::edition::Edition; use syntax::feature_gate::Features; use syntax::parse::parser::Parser; -use syntax::parse::token::TokenKind::*; -use syntax::parse::token::{self, NtTT, Token}; use syntax::parse::Directory; use syntax::print::pprust; use syntax::sess::ParseSess; use syntax::symbol::{kw, sym, Symbol}; +use syntax::token::{self, NtTT, Token, TokenKind::*}; use syntax::tokenstream::{DelimSpan, TokenStream}; use errors::{DiagnosticBuilder, FatalError}; diff --git a/src/libsyntax_expand/mbe/quoted.rs b/src/libsyntax_expand/mbe/quoted.rs index cedd59233adf5..dec504c0d9745 100644 --- a/src/libsyntax_expand/mbe/quoted.rs +++ b/src/libsyntax_expand/mbe/quoted.rs @@ -2,10 +2,10 @@ use crate::mbe::macro_parser; use crate::mbe::{TokenTree, KleeneOp, KleeneToken, SequenceRepetition, Delimited}; use syntax::ast; -use syntax::parse::token::{self, Token}; use syntax::print::pprust; use syntax::sess::ParseSess; use syntax::symbol::kw; +use syntax::token::{self, Token}; use syntax::tokenstream; use syntax_pos::Span; diff --git a/src/libsyntax_expand/mbe/transcribe.rs b/src/libsyntax_expand/mbe/transcribe.rs index 6f060103ef48e..4092d4b97de04 100644 --- a/src/libsyntax_expand/mbe/transcribe.rs +++ b/src/libsyntax_expand/mbe/transcribe.rs @@ -4,7 +4,7 @@ use crate::mbe::macro_parser::{MatchedNonterminal, MatchedSeq, NamedMatch}; use syntax::ast::{Ident, Mac}; use syntax::mut_visit::{self, MutVisitor}; -use syntax::parse::token::{self, NtTT, Token}; +use syntax::token::{self, NtTT, Token}; use syntax::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndJoint}; use smallvec::{smallvec, SmallVec}; diff --git a/src/libsyntax_expand/proc_macro.rs b/src/libsyntax_expand/proc_macro.rs index 1f4c481e3ea04..51c368bbaa606 100644 --- a/src/libsyntax_expand/proc_macro.rs +++ b/src/libsyntax_expand/proc_macro.rs @@ -4,8 +4,9 @@ use crate::proc_macro_server; use syntax::ast::{self, ItemKind, Attribute, Mac}; use syntax::attr::{mark_used, mark_known}; use syntax::errors::{Applicability, FatalError}; -use syntax::parse::{self, token}; +use syntax::parse; use syntax::symbol::sym; +use syntax::token; use syntax::tokenstream::{self, TokenStream}; use syntax::visit::Visitor; diff --git a/src/libsyntax_expand/proc_macro_server.rs b/src/libsyntax_expand/proc_macro_server.rs index 4ce99cfe73b5c..67a15e48205b9 100644 --- a/src/libsyntax_expand/proc_macro_server.rs +++ b/src/libsyntax_expand/proc_macro_server.rs @@ -1,10 +1,11 @@ use crate::base::ExtCtxt; use syntax::ast; -use syntax::parse::{self, token}; +use syntax::parse::{self}; use syntax::parse::lexer::comments; use syntax::print::pprust; use syntax::sess::ParseSess; +use syntax::token; use syntax::tokenstream::{self, DelimSpan, IsJoint::*, TokenStream, TreeAndJoint}; use errors::Diagnostic; @@ -52,7 +53,7 @@ impl FromInternal<(TreeAndJoint, &'_ ParseSess, &'_ mut Vec)> { fn from_internal(((tree, is_joint), sess, stack): (TreeAndJoint, &ParseSess, &mut Vec)) -> Self { - use syntax::parse::token::*; + use syntax::token::*; let joint = is_joint == Joint; let Token { kind, span } = match tree { @@ -193,7 +194,7 @@ impl FromInternal<(TreeAndJoint, &'_ ParseSess, &'_ mut Vec)> impl ToInternal for TokenTree { fn to_internal(self) -> TokenStream { - use syntax::parse::token::*; + use syntax::token::*; let (ch, joint, span) = match self { TokenTree::Punct(Punct { ch, joint, span }) => (ch, joint, span), diff --git a/src/libsyntax_ext/asm.rs b/src/libsyntax_ext/asm.rs index 8c9a34713ea60..539d777105d74 100644 --- a/src/libsyntax_ext/asm.rs +++ b/src/libsyntax_ext/asm.rs @@ -8,7 +8,7 @@ use errors::DiagnosticBuilder; use syntax::ast; use syntax_expand::base::{self, *}; -use syntax::parse::token::{self, Token}; +use syntax::token::{self, Token}; use syntax::ptr::P; use syntax::symbol::{kw, sym, Symbol}; use syntax::ast::AsmDialect; diff --git a/src/libsyntax_ext/assert.rs b/src/libsyntax_ext/assert.rs index f4d1f7fb09cdf..a15423b7ad85a 100644 --- a/src/libsyntax_ext/assert.rs +++ b/src/libsyntax_ext/assert.rs @@ -2,7 +2,7 @@ use errors::{Applicability, DiagnosticBuilder}; use syntax::ast::{self, *}; use syntax_expand::base::*; -use syntax::parse::token::{self, TokenKind}; +use syntax::token::{self, TokenKind}; use syntax::parse::parser::Parser; use syntax::print::pprust; use syntax::ptr::P; diff --git a/src/libsyntax_ext/cfg.rs b/src/libsyntax_ext/cfg.rs index 9e693f29c5a3c..583236d97546d 100644 --- a/src/libsyntax_ext/cfg.rs +++ b/src/libsyntax_ext/cfg.rs @@ -8,7 +8,7 @@ use syntax::ast; use syntax_expand::base::{self, *}; use syntax::attr; use syntax::tokenstream::TokenStream; -use syntax::parse::token; +use syntax::token; use syntax_pos::Span; pub fn expand_cfg( diff --git a/src/libsyntax_ext/cmdline_attrs.rs b/src/libsyntax_ext/cmdline_attrs.rs index 2d981526a3983..171f2405573c0 100644 --- a/src/libsyntax_ext/cmdline_attrs.rs +++ b/src/libsyntax_ext/cmdline_attrs.rs @@ -2,7 +2,8 @@ use syntax::ast::{self, AttrItem, AttrStyle}; use syntax::attr::mk_attr; -use syntax::parse::{self, token}; +use syntax::parse; +use syntax::token; use syntax::sess::ParseSess; use syntax_expand::panictry; use syntax_pos::FileName; diff --git a/src/libsyntax_ext/concat_idents.rs b/src/libsyntax_ext/concat_idents.rs index a132a4136ea01..8a1bc56cf1ced 100644 --- a/src/libsyntax_ext/concat_idents.rs +++ b/src/libsyntax_ext/concat_idents.rs @@ -2,7 +2,7 @@ use rustc_data_structures::thin_vec::ThinVec; use syntax::ast; use syntax_expand::base::{self, *}; -use syntax::parse::token::{self, Token}; +use syntax::token::{self, Token}; use syntax::ptr::P; use syntax_pos::Span; use syntax_pos::symbol::Symbol; diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 314c2eefd4c74..e25ba7b178371 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -9,7 +9,7 @@ use errors::pluralize; use syntax::ast; use syntax_expand::base::{self, *}; -use syntax::parse::token; +use syntax::token; use syntax::ptr::P; use syntax::symbol::{Symbol, sym}; use syntax::tokenstream::TokenStream; diff --git a/src/libsyntax_ext/global_asm.rs b/src/libsyntax_ext/global_asm.rs index 879ae1e42153d..8a8ce9a7f14b5 100644 --- a/src/libsyntax_ext/global_asm.rs +++ b/src/libsyntax_ext/global_asm.rs @@ -13,7 +13,7 @@ use errors::DiagnosticBuilder; use syntax::ast; use syntax::source_map::respan; use syntax_expand::base::{self, *}; -use syntax::parse::token; +use syntax::token; use syntax::ptr::P; use syntax_pos::Span; use syntax::tokenstream::TokenStream; diff --git a/src/libsyntax_ext/plugin_macro_defs.rs b/src/libsyntax_ext/plugin_macro_defs.rs index 1ca9422eb9dcc..cee1b97af55b2 100644 --- a/src/libsyntax_ext/plugin_macro_defs.rs +++ b/src/libsyntax_ext/plugin_macro_defs.rs @@ -4,12 +4,12 @@ use syntax::ast::*; use syntax::attr; use syntax::edition::Edition; -use syntax_expand::base::{Resolver, NamedSyntaxExtension}; -use syntax::parse::token; use syntax::ptr::P; use syntax::source_map::respan; use syntax::symbol::sym; +use syntax::token; use syntax::tokenstream::*; +use syntax_expand::base::{Resolver, NamedSyntaxExtension}; use syntax_pos::{Span, DUMMY_SP}; use syntax_pos::hygiene::{ExpnData, ExpnKind, AstPass}; diff --git a/src/libsyntax_ext/source_util.rs b/src/libsyntax_ext/source_util.rs index f6c58fcdfa1cb..7e47b40714da0 100644 --- a/src/libsyntax_ext/source_util.rs +++ b/src/libsyntax_ext/source_util.rs @@ -1,10 +1,11 @@ use syntax_expand::panictry; use syntax_expand::base::{self, *}; use syntax::ast; -use syntax::parse::{self, token, DirectoryOwnership}; +use syntax::parse::{self, DirectoryOwnership}; use syntax::print::pprust; use syntax::ptr::P; use syntax::symbol::Symbol; +use syntax::token; use syntax::tokenstream::TokenStream; use syntax::early_buffered_lints::BufferedEarlyLintId; diff --git a/src/test/ui-fulldeps/ast_stmt_expr_attr.rs b/src/test/ui-fulldeps/ast_stmt_expr_attr.rs index 927e2c0820eb2..6277e2e7ea9b9 100644 --- a/src/test/ui-fulldeps/ast_stmt_expr_attr.rs +++ b/src/test/ui-fulldeps/ast_stmt_expr_attr.rs @@ -16,7 +16,7 @@ use syntax::parse; use syntax::parse::PResult; use syntax::parse::new_parser_from_source_str; use syntax::parse::parser::Parser; -use syntax::parse::token; +use syntax::token; use syntax::ptr::P; use syntax::parse::parser::attr::*; use syntax::print::pprust; diff --git a/src/test/ui-fulldeps/auxiliary/roman-numerals.rs b/src/test/ui-fulldeps/auxiliary/roman-numerals.rs index 3524f449c7452..520347faa15aa 100644 --- a/src/test/ui-fulldeps/auxiliary/roman-numerals.rs +++ b/src/test/ui-fulldeps/auxiliary/roman-numerals.rs @@ -15,7 +15,7 @@ extern crate syntax_pos; extern crate rustc; extern crate rustc_driver; -use syntax::parse::token::{self, Token}; +use syntax::token::{self, Token}; use syntax::tokenstream::{TokenTree, TokenStream}; use syntax_expand::base::{ExtCtxt, MacResult, DummyResult, MacEager}; use syntax_pos::Span; From 3667e6248ec18740ce57db7997333a30c991929b Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 13:06:36 +0200 Subject: [PATCH 20/24] move PResult to librustc_errors --- src/librustc_driver/lib.rs | 3 ++- src/librustc_errors/lib.rs | 10 +++++++++- src/librustc_interface/passes.rs | 3 ++- src/libsyntax/attr/mod.rs | 3 ++- src/libsyntax/parse/lexer/tokentrees.rs | 3 ++- src/libsyntax/parse/mod.rs | 11 +---------- src/libsyntax/parse/parser/attr.rs | 4 +++- src/libsyntax/parse/parser/diagnostics.rs | 8 +++----- src/libsyntax/parse/parser/expr.rs | 4 ++-- src/libsyntax/parse/parser/generics.rs | 4 +++- src/libsyntax/parse/parser/item.rs | 4 ++-- src/libsyntax/parse/parser/mod.rs | 4 ++-- src/libsyntax/parse/parser/module.rs | 4 +++- src/libsyntax/parse/parser/pat.rs | 4 ++-- src/libsyntax/parse/parser/path.rs | 4 ++-- src/libsyntax/parse/parser/stmt.rs | 4 ++-- src/libsyntax/parse/parser/ty.rs | 4 ++-- src/libsyntax/tests.rs | 4 ++-- src/libsyntax_expand/expand.rs | 4 ++-- src/libsyntax_expand/mbe/macro_parser.rs | 4 ++-- src/test/ui-fulldeps/ast_stmt_expr_attr.rs | 3 ++- 21 files changed, 52 insertions(+), 44 deletions(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index 6e8bc11162f66..611b891d99abf 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -42,6 +42,7 @@ use rustc::ty::TyCtxt; use rustc::util::common::{set_time_depth, time, print_time_passes_entry, ErrorReported}; use rustc_metadata::locator; use rustc_codegen_utils::codegen_backend::CodegenBackend; +use errors::PResult; use rustc_interface::interface; use rustc_interface::util::get_codegen_sysroot; use rustc_data_structures::sync::SeqCst; @@ -64,7 +65,7 @@ use std::time::Instant; use syntax::ast; use syntax::source_map::FileLoader; use syntax::feature_gate::{GatedCfg, UnstableFeatures}; -use syntax::parse::{self, PResult}; +use syntax::parse; use syntax::symbol::sym; use syntax_pos::{DUMMY_SP, FileName}; diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index 67c180a05e921..fb5cccf61a7a9 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -15,7 +15,8 @@ use Level::*; use emitter::{Emitter, EmitterWriter, is_case_difference}; use registry::Registry; - +#[cfg(target_arch = "x86_64")] +use rustc_data_structures::static_assert_size; use rustc_data_structures::sync::{self, Lrc, Lock}; use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; use rustc_data_structures::stable_hasher::StableHasher; @@ -48,6 +49,13 @@ use syntax_pos::{ SpanSnippetError, }; +pub type PResult<'a, T> = Result>; + +// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger. +// (See also the comment on `DiagnosticBuilderInner`.) +#[cfg(target_arch = "x86_64")] +static_assert_size!(PResult<'_, bool>, 16); + /// Indicates the confidence in the correctness of a suggestion. /// /// All suggestions are marked with an `Applicability`. Tools use the applicability of a suggestion diff --git a/src/librustc_interface/passes.rs b/src/librustc_interface/passes.rs index 52332744d1ad5..ce34caee6fab3 100644 --- a/src/librustc_interface/passes.rs +++ b/src/librustc_interface/passes.rs @@ -22,6 +22,7 @@ use rustc_codegen_utils::codegen_backend::CodegenBackend; use rustc_codegen_utils::link::filename_for_metadata; use rustc_data_structures::{box_region_allow_access, declare_box_region_type, parallel}; use rustc_data_structures::sync::{Lrc, ParallelIterator, par_iter}; +use rustc_errors::PResult; use rustc_incremental; use rustc_metadata::cstore; use rustc_mir as mir; @@ -36,7 +37,7 @@ use syntax::{self, ast, visit}; use syntax::early_buffered_lints::BufferedEarlyLint; use syntax_expand::base::{NamedSyntaxExtension, ExtCtxt}; use syntax::mut_visit::MutVisitor; -use syntax::parse::{self, PResult}; +use syntax::parse; use syntax::util::node_count::NodeCounter; use syntax::symbol::Symbol; use syntax_pos::FileName; diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index 1534d2723c877..d609225a54fac 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -16,7 +16,6 @@ use crate::mut_visit::visit_clobber; use crate::source_map::{BytePos, Spanned}; use crate::parse::lexer::comments::doc_comment_style; use crate::parse; -use crate::parse::PResult; use crate::token::{self, Token}; use crate::ptr::P; use crate::sess::ParseSess; @@ -25,6 +24,8 @@ use crate::ThinVec; use crate::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndJoint}; use crate::GLOBALS; +use errors::PResult; + use log::debug; use syntax_pos::Span; diff --git a/src/libsyntax/parse/lexer/tokentrees.rs b/src/libsyntax/parse/lexer/tokentrees.rs index 3c15a5e1daeda..2b056434d4dcb 100644 --- a/src/libsyntax/parse/lexer/tokentrees.rs +++ b/src/libsyntax/parse/lexer/tokentrees.rs @@ -4,10 +4,11 @@ use syntax_pos::Span; use super::{StringReader, UnmatchedBrace}; use crate::print::pprust::token_to_string; -use crate::parse::PResult; use crate::token::{self, Token}; use crate::tokenstream::{DelimSpan, IsJoint::{self, *}, TokenStream, TokenTree, TreeAndJoint}; +use errors::PResult; + impl<'a> StringReader<'a> { crate fn into_token_trees(self) -> (PResult<'a, TokenStream>, Vec) { let mut tt_reader = TokenTreesReader { diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 7db0ca0b78d3d..badf8bcba576e 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -7,9 +7,7 @@ use crate::tokenstream::{self, TokenStream, TokenTree}; use crate::print::pprust; use crate::sess::ParseSess; -use errors::{FatalError, Level, Diagnostic, DiagnosticBuilder}; -#[cfg(target_arch = "x86_64")] -use rustc_data_structures::static_assert_size; +use errors::{PResult, FatalError, Level, Diagnostic}; use rustc_data_structures::sync::Lrc; use syntax_pos::{Span, SourceFile, FileName}; @@ -29,13 +27,6 @@ pub mod lexer; crate mod classify; crate mod literal; -pub type PResult<'a, T> = Result>; - -// `PResult` is used a lot. Make sure it doesn't unintentionally get bigger. -// (See also the comment on `DiagnosticBuilderInner`.) -#[cfg(target_arch = "x86_64")] -static_assert_size!(PResult<'_, bool>, 16); - #[derive(Clone)] pub struct Directory<'a> { pub path: Cow<'a, Path>, diff --git a/src/libsyntax/parse/parser/attr.rs b/src/libsyntax/parse/parser/attr.rs index aa0542a09a925..2f1b87da7e966 100644 --- a/src/libsyntax/parse/parser/attr.rs +++ b/src/libsyntax/parse/parser/attr.rs @@ -1,10 +1,12 @@ -use super::{SeqSep, PResult, Parser, TokenType, PathStyle}; +use super::{SeqSep, Parser, TokenType, PathStyle}; use crate::attr; use crate::ast; use crate::token::{self, Nonterminal, DelimToken}; use crate::tokenstream::{TokenStream, TokenTree}; use crate::source_map::Span; +use errors::PResult; + use log::debug; #[derive(Debug)] diff --git a/src/libsyntax/parse/parser/diagnostics.rs b/src/libsyntax/parse/parser/diagnostics.rs index 09f0b9b74b2eb..26d7f48025eda 100644 --- a/src/libsyntax/parse/parser/diagnostics.rs +++ b/src/libsyntax/parse/parser/diagnostics.rs @@ -1,7 +1,4 @@ -use super::{ - BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType, - SeqSep, PResult, Parser -}; +use super::{BlockMode, PathStyle, SemiColonMode, TokenType, TokenExpectType, SeqSep, Parser}; use crate::ast::{ self, Param, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind, Ident, Item, ItemKind, Mutability, Pat, PatKind, PathSegment, QSelf, Ty, TyKind, @@ -12,7 +9,8 @@ use crate::ptr::P; use crate::symbol::{kw, sym}; use crate::ThinVec; use crate::util::parser::AssocOp; -use errors::{Applicability, DiagnosticBuilder, DiagnosticId, pluralize}; + +use errors::{PResult, Applicability, DiagnosticBuilder, DiagnosticId, pluralize}; use rustc_data_structures::fx::FxHashSet; use syntax_pos::{Span, DUMMY_SP, MultiSpan, SpanSnippetError}; use log::{debug, trace}; diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index 4b962201e8556..9faa4aefbb6ef 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult, Restrictions, PrevTokenKind, TokenType, PathStyle, BlockMode}; +use super::{Parser, Restrictions, PrevTokenKind, TokenType, PathStyle, BlockMode}; use super::{SemiColonMode, SeqSep, TokenExpectType}; use super::pat::{GateOr, PARAM_EXPECTED}; use super::diagnostics::Error; @@ -18,7 +18,7 @@ use crate::ptr::P; use crate::source_map::{self, Span}; use crate::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par}; -use errors::Applicability; +use errors::{PResult, Applicability}; use syntax_pos::symbol::{kw, sym}; use syntax_pos::Symbol; use std::mem; diff --git a/src/libsyntax/parse/parser/generics.rs b/src/libsyntax/parse/parser/generics.rs index cfc3768cac543..ae9ecd8fe3922 100644 --- a/src/libsyntax/parse/parser/generics.rs +++ b/src/libsyntax/parse/parser/generics.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult}; +use super::Parser; use crate::ast::{self, WhereClause, GenericParam, GenericParamKind, GenericBounds, Attribute}; use crate::token; @@ -6,6 +6,8 @@ use crate::source_map::DUMMY_SP; use syntax_pos::symbol::{kw, sym}; +use errors::PResult; + impl<'a> Parser<'a> { /// Parses bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`. /// diff --git a/src/libsyntax/parse/parser/item.rs b/src/libsyntax/parse/parser/item.rs index 9d543055f23a7..3c618d75d348f 100644 --- a/src/libsyntax/parse/parser/item.rs +++ b/src/libsyntax/parse/parser/item.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult, PathStyle}; +use super::{Parser, PathStyle}; use super::diagnostics::{Error, dummy_arg, ConsumeClosingDelim}; use crate::maybe_whole; @@ -17,7 +17,7 @@ use crate::ThinVec; use log::debug; use std::mem; -use errors::{Applicability, DiagnosticBuilder, DiagnosticId, StashKey}; +use errors::{PResult, Applicability, DiagnosticBuilder, DiagnosticId, StashKey}; use syntax_pos::BytePos; /// Whether the type alias or associated type is a concrete type or an opaque type. diff --git a/src/libsyntax/parse/parser/mod.rs b/src/libsyntax/parse/parser/mod.rs index 6498b674a3b7d..f7f7b0e83d4f4 100644 --- a/src/libsyntax/parse/parser/mod.rs +++ b/src/libsyntax/parse/parser/mod.rs @@ -15,7 +15,7 @@ use crate::ast::{ self, Abi, DUMMY_NODE_ID, AttrStyle, Attribute, CrateSugar, Ident, IsAsync, MacDelimiter, Mutability, StrStyle, Visibility, VisibilityKind, Unsafety, }; -use crate::parse::{PResult, Directory, DirectoryOwnership}; +use crate::parse::{Directory, DirectoryOwnership}; use crate::parse::lexer::UnmatchedBrace; use crate::parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; use crate::token::{self, Token, TokenKind, DelimToken}; @@ -27,7 +27,7 @@ use crate::symbol::{kw, sym, Symbol}; use crate::tokenstream::{self, DelimSpan, TokenTree, TokenStream, TreeAndJoint}; use crate::ThinVec; -use errors::{Applicability, DiagnosticBuilder, DiagnosticId, FatalError}; +use errors::{PResult, Applicability, DiagnosticBuilder, DiagnosticId, FatalError}; use syntax_pos::{Span, BytePos, DUMMY_SP, FileName}; use log::debug; diff --git a/src/libsyntax/parse/parser/module.rs b/src/libsyntax/parse/parser/module.rs index 70e0dfc3e8808..72049daaed309 100644 --- a/src/libsyntax/parse/parser/module.rs +++ b/src/libsyntax/parse/parser/module.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult}; +use super::Parser; use super::item::ItemInfo; use super::diagnostics::Error; @@ -9,6 +9,8 @@ use crate::token::{self, TokenKind}; use crate::source_map::{SourceMap, Span, DUMMY_SP, FileName}; use crate::symbol::sym; +use errors::PResult; + use std::path::{self, Path, PathBuf}; /// Information about the path to a module. diff --git a/src/libsyntax/parse/parser/pat.rs b/src/libsyntax/parse/parser/pat.rs index c4a983188faff..f347300da716f 100644 --- a/src/libsyntax/parse/parser/pat.rs +++ b/src/libsyntax/parse/parser/pat.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult, PathStyle}; +use super::{Parser, PathStyle}; use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole}; use crate::ptr::P; @@ -10,7 +10,7 @@ use crate::print::pprust; use crate::source_map::{respan, Span, Spanned}; use crate::ThinVec; use syntax_pos::symbol::{kw, sym}; -use errors::{Applicability, DiagnosticBuilder}; +use errors::{PResult, Applicability, DiagnosticBuilder}; type Expected = Option<&'static str>; diff --git a/src/libsyntax/parse/parser/path.rs b/src/libsyntax/parse/parser/path.rs index 2659e0c680e3f..9ceb3ba1eb491 100644 --- a/src/libsyntax/parse/parser/path.rs +++ b/src/libsyntax/parse/parser/path.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult, TokenType}; +use super::{Parser, TokenType}; use crate::{maybe_whole, ThinVec}; use crate::ast::{self, QSelf, Path, PathSegment, Ident, ParenthesizedArgs, AngleBracketedArgs}; @@ -9,7 +9,7 @@ use syntax_pos::symbol::{kw, sym}; use std::mem; use log::debug; -use errors::{Applicability, pluralize}; +use errors::{PResult, Applicability, pluralize}; /// Specifies how to parse a path. #[derive(Copy, Clone, PartialEq)] diff --git a/src/libsyntax/parse/parser/stmt.rs b/src/libsyntax/parse/parser/stmt.rs index 010fd9c37fd71..2a3d6b05bb988 100644 --- a/src/libsyntax/parse/parser/stmt.rs +++ b/src/libsyntax/parse/parser/stmt.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult, Restrictions, PrevTokenKind, SemiColonMode, BlockMode}; +use super::{Parser, Restrictions, PrevTokenKind, SemiColonMode, BlockMode}; use super::expr::LhsExpr; use super::path::PathStyle; use super::pat::GateOr; @@ -14,7 +14,7 @@ use crate::source_map::{respan, Span}; use crate::symbol::{kw, sym}; use std::mem; -use errors::Applicability; +use errors::{PResult, Applicability}; impl<'a> Parser<'a> { /// Parses a statement. This stops just before trailing semicolons on everything but items. diff --git a/src/libsyntax/parse/parser/ty.rs b/src/libsyntax/parse/parser/ty.rs index 4183416e628cc..a891634e611da 100644 --- a/src/libsyntax/parse/parser/ty.rs +++ b/src/libsyntax/parse/parser/ty.rs @@ -1,4 +1,4 @@ -use super::{Parser, PResult, PathStyle, PrevTokenKind, TokenType}; +use super::{Parser, PathStyle, PrevTokenKind, TokenType}; use super::item::ParamCfg; use crate::{maybe_whole, maybe_recover_from_interpolated_ty_qpath}; @@ -10,7 +10,7 @@ use crate::token::{self, Token}; use crate::source_map::Span; use crate::symbol::{kw}; -use errors::{Applicability, pluralize}; +use errors::{PResult, Applicability, pluralize}; /// Returns `true` if `IDENT t` can start a type -- `IDENT::a::b`, `IDENT`, /// `IDENT<::AssocTy>`. diff --git a/src/libsyntax/tests.rs b/src/libsyntax/tests.rs index e73c8b43bccbf..ed457c3627f42 100644 --- a/src/libsyntax/tests.rs +++ b/src/libsyntax/tests.rs @@ -1,5 +1,5 @@ use crate::ast; -use crate::parse::{PResult, source_file_to_stream}; +use crate::parse::source_file_to_stream; use crate::parse::new_parser_from_source_str; use crate::parse::parser::Parser; use crate::sess::ParseSess; @@ -8,7 +8,7 @@ use crate::tokenstream::TokenStream; use crate::with_default_globals; use errors::emitter::EmitterWriter; -use errors::Handler; +use errors::{PResult, Handler}; use rustc_data_structures::sync::Lrc; use syntax_pos::{BytePos, Span, MultiSpan}; diff --git a/src/libsyntax_expand/expand.rs b/src/libsyntax_expand/expand.rs index 6d1f0abe49eaf..e91dd2aba1537 100644 --- a/src/libsyntax_expand/expand.rs +++ b/src/libsyntax_expand/expand.rs @@ -12,7 +12,7 @@ use syntax::configure; use syntax::config::StripUnconfigured; use syntax::feature_gate::{self, Features, GateIssue, is_builtin_attr, emit_feature_err}; use syntax::mut_visit::*; -use syntax::parse::{DirectoryOwnership, PResult}; +use syntax::parse::DirectoryOwnership; use syntax::parse::parser::Parser; use syntax::print::pprust; use syntax::ptr::P; @@ -23,7 +23,7 @@ use syntax::tokenstream::{TokenStream, TokenTree}; use syntax::visit::{self, Visitor}; use syntax::util::map_in_place::MapInPlace; -use errors::{Applicability, FatalError}; +use errors::{PResult, Applicability, FatalError}; use smallvec::{smallvec, SmallVec}; use syntax_pos::{Span, DUMMY_SP, FileName}; diff --git a/src/libsyntax_expand/mbe/macro_parser.rs b/src/libsyntax_expand/mbe/macro_parser.rs index 950e7c0f286fa..80bf27e1a941e 100644 --- a/src/libsyntax_expand/mbe/macro_parser.rs +++ b/src/libsyntax_expand/mbe/macro_parser.rs @@ -77,7 +77,7 @@ use TokenTreeOrTokenTreeSlice::*; use crate::mbe::{self, TokenTree}; use syntax::ast::{Ident, Name}; -use syntax::parse::{Directory, PResult}; +use syntax::parse::Directory; use syntax::parse::parser::{Parser, PathStyle}; use syntax::print::pprust; use syntax::sess::ParseSess; @@ -85,7 +85,7 @@ use syntax::symbol::{kw, sym, Symbol}; use syntax::token::{self, DocComment, Nonterminal, Token}; use syntax::tokenstream::{DelimSpan, TokenStream}; -use errors::FatalError; +use errors::{PResult, FatalError}; use smallvec::{smallvec, SmallVec}; use syntax_pos::Span; diff --git a/src/test/ui-fulldeps/ast_stmt_expr_attr.rs b/src/test/ui-fulldeps/ast_stmt_expr_attr.rs index 6277e2e7ea9b9..ac864e767848f 100644 --- a/src/test/ui-fulldeps/ast_stmt_expr_attr.rs +++ b/src/test/ui-fulldeps/ast_stmt_expr_attr.rs @@ -6,14 +6,15 @@ #![feature(rustc_private)] extern crate syntax; +extern crate rustc_errors; +use rustc_errors::PResult; use syntax::ast::*; use syntax::attr::*; use syntax::ast; use syntax::sess::ParseSess; use syntax::source_map::{FilePathMapping, FileName}; use syntax::parse; -use syntax::parse::PResult; use syntax::parse::new_parser_from_source_str; use syntax::parse::parser::Parser; use syntax::token; From 255b12a8d3ef3639b4b389fc56d93bd80f03d087 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 13:17:20 +0200 Subject: [PATCH 21/24] move parse::classify -> util::classify --- src/libsyntax/lib.rs | 1 + src/libsyntax/parse/mod.rs | 1 - src/libsyntax/parse/parser/expr.rs | 2 +- src/libsyntax/parse/parser/stmt.rs | 3 ++- src/libsyntax/print/pprust.rs | 4 ++-- src/libsyntax/{parse => util}/classify.rs | 0 6 files changed, 6 insertions(+), 5 deletions(-) rename src/libsyntax/{parse => util}/classify.rs (100%) diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 4c134430f30e6..205fbe3c52eea 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -85,6 +85,7 @@ pub mod diagnostics { pub mod error_codes; pub mod util { + crate mod classify; pub mod lev_distance; pub mod node_count; pub mod parser; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index badf8bcba576e..44fd39448e548 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -24,7 +24,6 @@ mod tests; pub mod parser; pub mod lexer; -crate mod classify; crate mod literal; #[derive(Clone)] diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index 9faa4aefbb6ef..cc984f03c7d17 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -11,11 +11,11 @@ use crate::ast::{ FunctionRetTy, Param, FnDecl, BinOpKind, BinOp, UnOp, Mac, AnonConst, Field, Lit, }; use crate::maybe_recover_from_interpolated_ty_qpath; -use crate::parse::classify; use crate::token::{self, Token, TokenKind}; use crate::print::pprust; use crate::ptr::P; use crate::source_map::{self, Span}; +use crate::util::classify; use crate::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par}; use errors::{PResult, Applicability}; diff --git a/src/libsyntax/parse/parser/stmt.rs b/src/libsyntax/parse/parser/stmt.rs index 2a3d6b05bb988..30e47b7a0b24d 100644 --- a/src/libsyntax/parse/parser/stmt.rs +++ b/src/libsyntax/parse/parser/stmt.rs @@ -8,7 +8,8 @@ use crate::ptr::P; use crate::{maybe_whole, ThinVec}; use crate::ast::{self, DUMMY_NODE_ID, Stmt, StmtKind, Local, Block, BlockCheckMode, Expr, ExprKind}; use crate::ast::{Attribute, AttrStyle, VisibilityKind, MacStmtStyle, Mac, MacDelimiter}; -use crate::parse::{classify, DirectoryOwnership}; +use crate::parse::DirectoryOwnership; +use crate::util::classify; use crate::token; use crate::source_map::{respan, Span}; use crate::symbol::{kw, sym}; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 049f34efc262c..0b72b034c2032 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -6,10 +6,10 @@ use crate::attr; use crate::source_map::{self, SourceMap, Spanned}; use crate::token::{self, BinOpToken, DelimToken, Nonterminal, Token, TokenKind}; use crate::parse::lexer::comments; -use crate::parse; use crate::print::pp::{self, Breaks}; use crate::print::pp::Breaks::{Consistent, Inconsistent}; use crate::ptr::P; +use crate::util::classify; use crate::sess::ParseSess; use crate::symbol::{kw, sym}; use crate::tokenstream::{self, TokenStream, TokenTree}; @@ -1659,7 +1659,7 @@ impl<'a> State<'a> { ast::StmtKind::Expr(ref expr) => { self.space_if_not_bol(); self.print_expr_outer_attr_style(expr, false); - if parse::classify::expr_requires_semi_to_be_stmt(expr) { + if classify::expr_requires_semi_to_be_stmt(expr) { self.s.word(";"); } } diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/util/classify.rs similarity index 100% rename from src/libsyntax/parse/classify.rs rename to src/libsyntax/util/classify.rs From a1571b68552b0d56d85080c5f92fdab233775de4 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 14:14:30 +0200 Subject: [PATCH 22/24] syntax::attr: remove usage of lexer --- src/libsyntax/attr/mod.rs | 5 ++--- src/libsyntax/parse/parser/attr.rs | 11 +++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs index d609225a54fac..c639431794c50 100644 --- a/src/libsyntax/attr/mod.rs +++ b/src/libsyntax/attr/mod.rs @@ -14,7 +14,6 @@ use crate::ast::{MetaItem, MetaItemKind, NestedMetaItem}; use crate::ast::{Lit, LitKind, Expr, Item, Local, Stmt, StmtKind, GenericParam}; use crate::mut_visit::visit_clobber; use crate::source_map::{BytePos, Spanned}; -use crate::parse::lexer::comments::doc_comment_style; use crate::parse; use crate::token::{self, Token}; use crate::ptr::P; @@ -401,11 +400,11 @@ pub fn mk_attr_outer(item: MetaItem) -> Attribute { mk_attr(AttrStyle::Outer, item.path, item.kind.tokens(item.span), item.span) } -pub fn mk_doc_comment(comment: Symbol, span: Span) -> Attribute { +pub fn mk_doc_comment(style: AttrStyle, comment: Symbol, span: Span) -> Attribute { Attribute { kind: AttrKind::DocComment(comment), id: mk_attr_id(), - style: doc_comment_style(&comment.as_str()), + style, span, } } diff --git a/src/libsyntax/parse/parser/attr.rs b/src/libsyntax/parse/parser/attr.rs index 2f1b87da7e966..920e7a521ef74 100644 --- a/src/libsyntax/parse/parser/attr.rs +++ b/src/libsyntax/parse/parser/attr.rs @@ -1,10 +1,12 @@ use super::{SeqSep, Parser, TokenType, PathStyle}; use crate::attr; use crate::ast; +use crate::parse::lexer::comments; use crate::token::{self, Nonterminal, DelimToken}; use crate::tokenstream::{TokenStream, TokenTree}; use crate::source_map::Span; +use syntax_pos::Symbol; use errors::PResult; use log::debug; @@ -45,7 +47,7 @@ impl<'a> Parser<'a> { just_parsed_doc_comment = false; } token::DocComment(s) => { - let attr = attr::mk_doc_comment(s, self.token.span); + let attr = self.mk_doc_comment(s); if attr.style != ast::AttrStyle::Outer { let mut err = self.fatal("expected outer doc comment"); err.note("inner doc comments like this (starting with \ @@ -62,6 +64,11 @@ impl<'a> Parser<'a> { Ok(attrs) } + fn mk_doc_comment(&self, s: Symbol) -> ast::Attribute { + let style = comments::doc_comment_style(&s.as_str()); + attr::mk_doc_comment(style, s, self.token.span) + } + /// Matches `attribute = # ! [ meta_item ]`. /// /// If `permit_inner` is `true`, then a leading `!` indicates an inner @@ -230,7 +237,7 @@ impl<'a> Parser<'a> { } token::DocComment(s) => { // We need to get the position of this token before we bump. - let attr = attr::mk_doc_comment(s, self.token.span); + let attr = self.mk_doc_comment(s); if attr.style == ast::AttrStyle::Inner { attrs.push(attr); self.bump(); From 27f97aa468b5079bfd159e6fee9a04d5501a8818 Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 14:39:52 +0200 Subject: [PATCH 23/24] move syntax::parse::lexer::comments -> syntax::util::comments --- src/librustc_save_analysis/lib.rs | 2 +- src/librustdoc/clean/mod.rs | 2 +- src/libsyntax/lib.rs | 1 + src/libsyntax/parse/lexer/mod.rs | 21 +++-------------- src/libsyntax/parse/lexer/tests.rs | 1 + src/libsyntax/parse/parser/attr.rs | 2 +- src/libsyntax/parse/parser/mod.rs | 2 +- src/libsyntax/print/pprust.rs | 2 +- .../{parse/lexer => util}/comments.rs | 23 +++++++++++++++---- .../{parse/lexer => util}/comments/tests.rs | 0 src/libsyntax_expand/proc_macro_server.rs | 4 ++-- 11 files changed, 31 insertions(+), 29 deletions(-) rename src/libsyntax/{parse/lexer => util}/comments.rs (92%) rename src/libsyntax/{parse/lexer => util}/comments/tests.rs (100%) diff --git a/src/librustc_save_analysis/lib.rs b/src/librustc_save_analysis/lib.rs index 9408bbe557a21..a2f8837c58134 100644 --- a/src/librustc_save_analysis/lib.rs +++ b/src/librustc_save_analysis/lib.rs @@ -29,7 +29,7 @@ use std::path::{Path, PathBuf}; use syntax::ast::{self, Attribute, DUMMY_NODE_ID, NodeId, PatKind}; use syntax::source_map::Spanned; -use syntax::parse::lexer::comments::strip_doc_comment_decoration; +use syntax::util::comments::strip_doc_comment_decoration; use syntax::print::pprust; use syntax::visit::{self, Visitor}; use syntax::print::pprust::{param_to_string, ty_to_string}; diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index 0c670e5e7179a..f6cac8ca48d5c 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -28,7 +28,7 @@ use rustc::ty::layout::VariantIdx; use rustc::util::nodemap::{FxHashMap, FxHashSet}; use syntax::ast::{self, Attribute, AttrStyle, AttrKind, Ident}; use syntax::attr; -use syntax::parse::lexer::comments; +use syntax::util::comments; use syntax::source_map::DUMMY_SP; use syntax_pos::symbol::{Symbol, kw, sym}; use syntax_pos::hygiene::MacroKind; diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 205fbe3c52eea..bdad52bfb459b 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -86,6 +86,7 @@ pub mod error_codes; pub mod util { crate mod classify; + pub mod comments; pub mod lev_distance; pub mod node_count; pub mod parser; diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 5499a3cae5f73..b1b7b08c78a3b 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -1,6 +1,7 @@ use crate::token::{self, Token, TokenKind}; use crate::sess::ParseSess; use crate::symbol::{sym, Symbol}; +use crate::util::comments; use errors::{FatalError, DiagnosticBuilder}; use syntax_pos::{BytePos, Pos, Span}; @@ -15,7 +16,6 @@ use log::debug; #[cfg(test)] mod tests; -pub mod comments; mod tokentrees; mod unicode_chars; mod unescape_error_reporting; @@ -179,7 +179,7 @@ impl<'a> StringReader<'a> { rustc_lexer::TokenKind::LineComment => { let string = self.str_from(start); // comments with only more "/"s are not doc comments - let tok = if is_doc_comment(string) { + let tok = if comments::is_line_doc_comment(string) { self.forbid_bare_cr(start, string, "bare CR not allowed in doc-comment"); token::DocComment(Symbol::intern(string)) } else { @@ -192,7 +192,7 @@ impl<'a> StringReader<'a> { let string = self.str_from(start); // block comments starting with "/**" or "/*!" are doc-comments // but comments with only "*"s between two "/"s are not - let is_doc_comment = is_block_doc_comment(string); + let is_doc_comment = comments::is_block_doc_comment(string); if !terminated { let msg = if is_doc_comment { @@ -643,18 +643,3 @@ impl<'a> StringReader<'a> { } } } - -fn is_doc_comment(s: &str) -> bool { - let res = (s.starts_with("///") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'/') || - s.starts_with("//!"); - debug!("is {:?} a doc comment? {}", s, res); - res -} - -fn is_block_doc_comment(s: &str) -> bool { - // Prevent `/**/` from being parsed as a doc comment - let res = ((s.starts_with("/**") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'*') || - s.starts_with("/*!")) && s.len() >= 5; - debug!("is {:?} a doc comment? {}", s, res); - res -} diff --git a/src/libsyntax/parse/lexer/tests.rs b/src/libsyntax/parse/lexer/tests.rs index b9b82b2bcefa7..baa6fb59537e3 100644 --- a/src/libsyntax/parse/lexer/tests.rs +++ b/src/libsyntax/parse/lexer/tests.rs @@ -3,6 +3,7 @@ use super::*; use crate::symbol::Symbol; use crate::source_map::{SourceMap, FilePathMapping}; use crate::token; +use crate::util::comments::is_doc_comment; use crate::with_default_globals; use errors::{Handler, emitter::EmitterWriter}; diff --git a/src/libsyntax/parse/parser/attr.rs b/src/libsyntax/parse/parser/attr.rs index 920e7a521ef74..31f0a02a483bd 100644 --- a/src/libsyntax/parse/parser/attr.rs +++ b/src/libsyntax/parse/parser/attr.rs @@ -1,7 +1,7 @@ use super::{SeqSep, Parser, TokenType, PathStyle}; use crate::attr; use crate::ast; -use crate::parse::lexer::comments; +use crate::util::comments; use crate::token::{self, Nonterminal, DelimToken}; use crate::tokenstream::{TokenStream, TokenTree}; use crate::source_map::Span; diff --git a/src/libsyntax/parse/parser/mod.rs b/src/libsyntax/parse/parser/mod.rs index f7f7b0e83d4f4..455f4172f5fba 100644 --- a/src/libsyntax/parse/parser/mod.rs +++ b/src/libsyntax/parse/parser/mod.rs @@ -17,7 +17,7 @@ use crate::ast::{ }; use crate::parse::{Directory, DirectoryOwnership}; use crate::parse::lexer::UnmatchedBrace; -use crate::parse::lexer::comments::{doc_comment_style, strip_doc_comment_decoration}; +use crate::util::comments::{doc_comment_style, strip_doc_comment_decoration}; use crate::token::{self, Token, TokenKind, DelimToken}; use crate::print::pprust; use crate::ptr::P; diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 0b72b034c2032..4ca4bdeb04654 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2,10 +2,10 @@ use crate::ast::{self, BlockCheckMode, PatKind, RangeEnd, RangeSyntax}; use crate::ast::{SelfKind, GenericBound, TraitBoundModifier}; use crate::ast::{Attribute, MacDelimiter, GenericArg}; use crate::util::parser::{self, AssocOp, Fixity}; +use crate::util::comments; use crate::attr; use crate::source_map::{self, SourceMap, Spanned}; use crate::token::{self, BinOpToken, DelimToken, Nonterminal, Token, TokenKind}; -use crate::parse::lexer::comments; use crate::print::pp::{self, Breaks}; use crate::print::pp::Breaks::{Consistent, Inconsistent}; use crate::ptr::P; diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/util/comments.rs similarity index 92% rename from src/libsyntax/parse/lexer/comments.rs rename to src/libsyntax/util/comments.rs index 33415bdcb62e7..448b4f3b8256c 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/util/comments.rs @@ -1,7 +1,5 @@ pub use CommentStyle::*; -use super::is_block_doc_comment; - use crate::ast; use crate::source_map::SourceMap; use crate::sess::ParseSess; @@ -10,6 +8,8 @@ use syntax_pos::{BytePos, CharPos, Pos, FileName}; use std::usize; +use log::debug; + #[cfg(test)] mod tests; @@ -32,8 +32,23 @@ pub struct Comment { pub pos: BytePos, } -fn is_doc_comment(s: &str) -> bool { - (s.starts_with("///") && super::is_doc_comment(s)) || s.starts_with("//!") || +crate fn is_line_doc_comment(s: &str) -> bool { + let res = (s.starts_with("///") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'/') || + s.starts_with("//!"); + debug!("is {:?} a doc comment? {}", s, res); + res +} + +crate fn is_block_doc_comment(s: &str) -> bool { + // Prevent `/**/` from being parsed as a doc comment + let res = ((s.starts_with("/**") && *s.as_bytes().get(3).unwrap_or(&b' ') != b'*') || + s.starts_with("/*!")) && s.len() >= 5; + debug!("is {:?} a doc comment? {}", s, res); + res +} + +crate fn is_doc_comment(s: &str) -> bool { + (s.starts_with("///") && is_line_doc_comment(s)) || s.starts_with("//!") || (s.starts_with("/**") && is_block_doc_comment(s)) || s.starts_with("/*!") } diff --git a/src/libsyntax/parse/lexer/comments/tests.rs b/src/libsyntax/util/comments/tests.rs similarity index 100% rename from src/libsyntax/parse/lexer/comments/tests.rs rename to src/libsyntax/util/comments/tests.rs diff --git a/src/libsyntax_expand/proc_macro_server.rs b/src/libsyntax_expand/proc_macro_server.rs index 67a15e48205b9..e96b60927873b 100644 --- a/src/libsyntax_expand/proc_macro_server.rs +++ b/src/libsyntax_expand/proc_macro_server.rs @@ -1,8 +1,8 @@ use crate::base::ExtCtxt; use syntax::ast; -use syntax::parse::{self}; -use syntax::parse::lexer::comments; +use syntax::parse; +use syntax::util::comments; use syntax::print::pprust; use syntax::sess::ParseSess; use syntax::token; From cc9c139694389c8df158640d4bcc20a2fe31f1ea Mon Sep 17 00:00:00 2001 From: Mazdak Farrokhzad Date: Fri, 11 Oct 2019 18:47:14 +0200 Subject: [PATCH 24/24] move syntax::{parse::literal -> util::literal} --- src/libsyntax/lib.rs | 1 + src/libsyntax/parse/mod.rs | 2 -- src/libsyntax/parse/parser/expr.rs | 3 +-- src/libsyntax/{parse => util}/literal.rs | 0 4 files changed, 2 insertions(+), 4 deletions(-) rename src/libsyntax/{parse => util}/literal.rs (100%) diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index bdad52bfb459b..1b17de529c415 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -88,6 +88,7 @@ pub mod util { crate mod classify; pub mod comments; pub mod lev_distance; + crate mod literal; pub mod node_count; pub mod parser; pub mod map_in_place; diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 44fd39448e548..1855076201795 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -24,8 +24,6 @@ mod tests; pub mod parser; pub mod lexer; -crate mod literal; - #[derive(Clone)] pub struct Directory<'a> { pub path: Cow<'a, Path>, diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index cc984f03c7d17..800074035ce8b 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -3,8 +3,6 @@ use super::{SemiColonMode, SeqSep, TokenExpectType}; use super::pat::{GateOr, PARAM_EXPECTED}; use super::diagnostics::Error; -use crate::parse::literal::LitError; - use crate::ast::{ self, DUMMY_NODE_ID, Attribute, AttrStyle, Ident, CaptureBy, BlockCheckMode, Expr, ExprKind, RangeLimits, Label, Movability, IsAsync, Arm, Ty, TyKind, @@ -16,6 +14,7 @@ use crate::print::pprust; use crate::ptr::P; use crate::source_map::{self, Span}; use crate::util::classify; +use crate::util::literal::LitError; use crate::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par}; use errors::{PResult, Applicability}; diff --git a/src/libsyntax/parse/literal.rs b/src/libsyntax/util/literal.rs similarity index 100% rename from src/libsyntax/parse/literal.rs rename to src/libsyntax/util/literal.rs