diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
commit | 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch) | |
tree | 3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/ui-fulldeps/auxiliary | |
parent | Releasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui-fulldeps/auxiliary')
-rw-r--r-- | tests/ui-fulldeps/auxiliary/issue-13560-1.rs | 3 | ||||
-rw-r--r-- | tests/ui-fulldeps/auxiliary/issue-13560-2.rs | 3 | ||||
-rw-r--r-- | tests/ui-fulldeps/auxiliary/issue-13560-3.rs | 6 | ||||
-rw-r--r-- | tests/ui-fulldeps/auxiliary/issue-16822.rs | 20 | ||||
-rw-r--r-- | tests/ui-fulldeps/auxiliary/issue-18502.rs | 21 | ||||
-rw-r--r-- | tests/ui-fulldeps/auxiliary/issue-24106.rs | 13 | ||||
-rw-r--r-- | tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs | 80 | ||||
-rw-r--r-- | tests/ui-fulldeps/auxiliary/lint-for-crate.rs | 12 |
8 files changed, 5 insertions, 153 deletions
diff --git a/tests/ui-fulldeps/auxiliary/issue-13560-1.rs b/tests/ui-fulldeps/auxiliary/issue-13560-1.rs deleted file mode 100644 index c3a2ae679..000000000 --- a/tests/ui-fulldeps/auxiliary/issue-13560-1.rs +++ /dev/null @@ -1,3 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "dylib"] diff --git a/tests/ui-fulldeps/auxiliary/issue-13560-2.rs b/tests/ui-fulldeps/auxiliary/issue-13560-2.rs deleted file mode 100644 index 39c261e11..000000000 --- a/tests/ui-fulldeps/auxiliary/issue-13560-2.rs +++ /dev/null @@ -1,3 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] diff --git a/tests/ui-fulldeps/auxiliary/issue-13560-3.rs b/tests/ui-fulldeps/auxiliary/issue-13560-3.rs deleted file mode 100644 index e991bcc1a..000000000 --- a/tests/ui-fulldeps/auxiliary/issue-13560-3.rs +++ /dev/null @@ -1,6 +0,0 @@ -// no-prefer-dynamic - -#![crate_type = "rlib"] - -#[macro_use] #[no_link] extern crate issue_13560_1 as t1; -#[macro_use] extern crate issue_13560_2 as t2; diff --git a/tests/ui-fulldeps/auxiliary/issue-16822.rs b/tests/ui-fulldeps/auxiliary/issue-16822.rs deleted file mode 100644 index 9042dd391..000000000 --- a/tests/ui-fulldeps/auxiliary/issue-16822.rs +++ /dev/null @@ -1,20 +0,0 @@ -#![crate_type="lib"] - -use std::cell::RefCell; - -pub struct Window<Data>{ - pub data: RefCell<Data> -} - -impl<Data: Update> Window<Data> { - pub fn update(&self, e: i32) { - match e { - 1 => self.data.borrow_mut().update(), - _ => {} - } - } -} - -pub trait Update { - fn update(&mut self); -} diff --git a/tests/ui-fulldeps/auxiliary/issue-18502.rs b/tests/ui-fulldeps/auxiliary/issue-18502.rs deleted file mode 100644 index 4d4230607..000000000 --- a/tests/ui-fulldeps/auxiliary/issue-18502.rs +++ /dev/null @@ -1,21 +0,0 @@ -#![crate_type="lib"] - -struct Foo; -// This is the ICE trigger -struct Formatter; - -trait Show { - fn fmt(&self); -} - -impl Show for Foo { - fn fmt(&self) {} -} - -fn bar<T>(f: extern "Rust" fn(&T), t: &T) { } - -// ICE requirement: this has to be marked as inline -#[inline] -pub fn baz() { - bar(Show::fmt, &Foo); -} diff --git a/tests/ui-fulldeps/auxiliary/issue-24106.rs b/tests/ui-fulldeps/auxiliary/issue-24106.rs deleted file mode 100644 index 2c6a60348..000000000 --- a/tests/ui-fulldeps/auxiliary/issue-24106.rs +++ /dev/null @@ -1,13 +0,0 @@ -#![crate_type="lib"] - -enum E { E0 = 0, E1 = 1 } -const E0_U8: u8 = E::E0 as u8; -const E1_U8: u8 = E::E1 as u8; - -pub fn go<T>() { - match 0 { - E0_U8 => (), - E1_U8 => (), - _ => (), - } -} diff --git a/tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs b/tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs deleted file mode 100644 index a3b570ad8..000000000 --- a/tests/ui-fulldeps/auxiliary/lint-for-crate-rpass.rs +++ /dev/null @@ -1,80 +0,0 @@ -// force-host - -#![feature(rustc_private)] - -extern crate rustc_driver; -extern crate rustc_hir; -extern crate rustc_lint; -extern crate rustc_span; -#[macro_use] -extern crate rustc_session; -extern crate rustc_ast; - -use rustc_ast::attr; -use rustc_driver::plugin::Registry; -use rustc_lint::{LateContext, LateLintPass, LintContext, LintPass}; -use rustc_span::def_id::CRATE_DEF_ID; -use rustc_span::symbol::Symbol; - -macro_rules! fake_lint_pass { - ($struct:ident, $($attr:expr),*) => { - struct $struct; - - impl LintPass for $struct { - fn name(&self) -> &'static str { - stringify!($struct) - } - } - - impl LateLintPass<'_> for $struct { - fn check_crate(&mut self, cx: &LateContext) { - let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID); - let span = cx.tcx.def_span(CRATE_DEF_ID); - $( - if !cx.sess().contains_name(attrs, $attr) { - cx.lint(CRATE_NOT_OKAY, |lint| { - let msg = format!("crate is not marked with #![{}]", $attr); - lint.build(&msg).set_span(span).emit(); - }); - } - )* - } - } - - } -} - -declare_lint!(CRATE_NOT_OKAY, Warn, "crate not marked with #![crate_okay]"); -declare_lint!(CRATE_NOT_RED, Warn, "crate not marked with #![crate_red]"); -declare_lint!(CRATE_NOT_BLUE, Warn, "crate not marked with #![crate_blue]"); -declare_lint!(CRATE_NOT_GREY, Warn, "crate not marked with #![crate_grey]"); -declare_lint!(CRATE_NOT_GREEN, Warn, "crate not marked with #![crate_green]"); - -fake_lint_pass! { - PassOkay, - Symbol::intern("crate_okay") -} - -fake_lint_pass! { - PassRedBlue, - Symbol::intern("crate_red"), Symbol::intern("crate_blue") -} - -fake_lint_pass! { - PassGreyGreen, - Symbol::intern("crate_grey"), Symbol::intern("crate_green") -} - -#[no_mangle] -fn __rustc_plugin_registrar(reg: &mut Registry) { - reg.lint_store.register_lints(&[ - &CRATE_NOT_OKAY, - &CRATE_NOT_RED, - &CRATE_NOT_BLUE, - &CRATE_NOT_GREY, - &CRATE_NOT_GREEN, - ]); - reg.lint_store.register_late_pass(|_| Box::new(PassOkay)); - reg.lint_store.register_late_pass(|_| Box::new(PassRedBlue)); - reg.lint_store.register_late_pass(|_| Box::new(PassGreyGreen)); -} diff --git a/tests/ui-fulldeps/auxiliary/lint-for-crate.rs b/tests/ui-fulldeps/auxiliary/lint-for-crate.rs index 073da688c..6304c07d2 100644 --- a/tests/ui-fulldeps/auxiliary/lint-for-crate.rs +++ b/tests/ui-fulldeps/auxiliary/lint-for-crate.rs @@ -4,13 +4,13 @@ extern crate rustc_driver; extern crate rustc_hir; -#[macro_use] extern crate rustc_lint; #[macro_use] extern crate rustc_session; extern crate rustc_ast; extern crate rustc_span; +use rustc_ast::attr; use rustc_driver::plugin::Registry; use rustc_lint::{LateContext, LateLintPass, LintContext}; use rustc_span::def_id::CRATE_DEF_ID; @@ -28,12 +28,10 @@ impl<'tcx> LateLintPass<'tcx> for Pass { fn check_crate(&mut self, cx: &LateContext) { let attrs = cx.tcx.hir().attrs(rustc_hir::CRATE_HIR_ID); let span = cx.tcx.def_span(CRATE_DEF_ID); - if !cx.sess().contains_name(attrs, Symbol::intern("crate_okay")) { - cx.lint( - CRATE_NOT_OKAY, - "crate is not marked with #![crate_okay]", - |lint| lint.set_span(span) - ); + if !attr::contains_name(attrs, Symbol::intern("crate_okay")) { + cx.lint(CRATE_NOT_OKAY, "crate is not marked with #![crate_okay]", |lint| { + lint.set_span(span) + }); } } } |