Skip to content

Commit

Permalink
allow deprecations where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
leo60228 committed Nov 12, 2021
1 parent 2f0c0d4 commit cbab5cd
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_feature/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::UnstableFeatures;

#[test]
#[allow(deprecated, deprecated_in_future)]
fn rustc_bootstrap_parsing() {
let is_bootstrap = |env, krate| {
std::env::set_var("RUSTC_BOOTSTRAP", env);
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_interface/src/passes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ fn pre_expansion_lint(
/// syntax expansion, secondary `cfg` expansion, synthesis of a test
/// harness if one is to be provided, injection of a dependency on the
/// standard library and prelude, and name resolution.
#[allow(deprecated, deprecated_in_future)]
pub fn configure_and_expand(
sess: &Session,
lint_store: &LintStore,
Expand Down
1 change: 1 addition & 0 deletions library/std/src/process/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ fn test_add_to_env() {

#[test]
#[cfg_attr(target_os = "vxworks", ignore)]
#[allow(deprecated, deprecated_in_future)]
fn test_capture_env_at_spawn() {
use crate::env;

Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys/windows/process/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ fn test_make_command_line() {
// On Windows, environment args are case preserving but comparisons are case-insensitive.
// See: #85242
#[test]
#[allow(deprecated, deprecated_in_future)]
fn windows_env_unicode_case() {
let test_cases = [
("ä", "Ä"),
Expand Down
1 change: 1 addition & 0 deletions library/std/src/sys_common/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ impl CommandEnv {
}

// Apply these changes directly to the current environment
#[allow(deprecated, deprecated_in_future)]
pub fn apply(&self) {
if self.clear {
for (k, _) in env::vars_os() {
Expand Down
2 changes: 2 additions & 0 deletions library/std/tests/env.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated, deprecated_in_future)]

use std::env::*;
use std::ffi::{OsStr, OsString};

Expand Down
1 change: 1 addition & 0 deletions library/test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub fn test_main_static(tests: &[&TestDescAndFn]) {
///
/// This is the entry point for the main function generated by `rustc --test`
/// when panic=abort.
#[allow(deprecated, deprecated_in_future)]
pub fn test_main_static_abort(tests: &[&TestDescAndFn]) {
// If we're being run in SpawnedSecondary mode, run the test here. run_test
// will then exit the process.
Expand Down
1 change: 1 addition & 0 deletions library/test/src/term/terminfo/searcher/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use super::*;

#[test]
#[ignore = "buildbots don't have ncurses installed and I can't mock everything I need"]
#[allow(deprecated, deprecated_in_future)]
fn test_get_dbpath_for_term() {
// woefully inadequate test coverage
// note: current tests won't work with non-standard terminfo hierarchies (e.g., macOS's)
Expand Down
1 change: 1 addition & 0 deletions src/build_helper/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub fn tracked_env_var_os<K: AsRef<OsStr> + Display>(key: K) -> Option<OsString>
// the one we want to use. As such, we restore the environment to what bootstrap saw. This isn't
// perfect -- we might actually want to see something from Cargo's added library paths -- but
// for now it works.
#[allow(deprecated, deprecated_in_future)]
pub fn restore_library_path() {
let key = tracked_env_var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
if let Some(env) = tracked_env_var_os("REAL_LIBRARY_PATH") {
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/command/command-exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::env;
use std::os::unix::process::CommandExt;
use std::process::Command;

#[allow(deprecated, deprecated_in_future)]
fn main() {
let mut args = env::args();
let me = args.next().unwrap();
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/process/process-envs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub fn env_cmd() -> Command {
cmd
}

#[allow(deprecated, deprecated_in_future)]
fn main() {
// save original environment
let old_env = env::var_os("RUN_TEST_NEW_ENV");
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/process/process-remove-from-env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ pub fn env_cmd() -> Command {
cmd
}

#[allow(deprecated, deprecated_in_future)]
fn main() {
// save original environment
let old_env = env::var_os("RUN_TEST_NEW_ENV");
Expand Down
1 change: 1 addition & 0 deletions src/test/ui/std-backtrace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ fn main() {
}
}

#[allow(deprecated, deprecated_in_future)]
fn runtest(me: &str) {
env::remove_var("RUST_BACKTRACE");
env::remove_var("RUST_LIB_BACKTRACE");
Expand Down

0 comments on commit cbab5cd

Please sign in to comment.