Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't mask warnings, clean them up! #455

Merged
merged 2 commits into from
Oct 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ version = "1.0"
default-features = false

[dev-dependencies]
compiletest_rs = "0.2.1"
compiletest_rs = "0.3"
docopt = "0.7"
futures = "0.1.7"
rand = "0.3"
Expand Down
1 change: 0 additions & 1 deletion rayon-core/src/join/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use latch::{LatchProbe, SpinLatch};
#[allow(unused_imports)]
use log::Event::*;
use job::StackJob;
use registry::{self, WorkerThread};
Expand Down
7 changes: 0 additions & 7 deletions rayon-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,6 @@
#![deny(missing_debug_implementations)]
#![cfg_attr(test, feature(conservative_impl_trait))]

// If you're not compiling the unstable code, it often happens that
// there is stuff that is considered "dead code" and so forth. So
// disable warnings in that scenario.
#![cfg_attr(not(rayon_unstable), allow(warnings))]

#[allow(unused_imports)]
use log::Event::*;
use std::any::Any;
use std::env;
use std::error::Error;
Expand Down
9 changes: 5 additions & 4 deletions rayon-core/src/registry.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use ::{Configuration, ExitHandler, PanicHandler, StartHandler};
use coco::deque::{self, Worker, Stealer};
use job::{Job, JobRef, StackJob};
use job::{JobRef, StackJob};
#[cfg(rayon_unstable)]
use job::Job;
#[cfg(rayon_unstable)]
use internal::task::Task;
use latch::{LatchProbe, Latch, CountLatch, LockLatch, SpinLatch, TickleLatch};
#[allow(unused_imports)]
use log::Event::*;
use rand::{self, Rng};
use sleep::Sleep;
Expand Down Expand Up @@ -153,6 +154,7 @@ impl Registry {
Ok(registry.clone())
}

#[cfg(rayon_unstable)]
pub fn global() -> Arc<Registry> {
global_registry().clone()
}
Expand Down Expand Up @@ -261,9 +263,8 @@ impl Registry {

/// A little newtype wrapper for `T`, just because I did not
/// want to implement `Job` for all `T: Task`.
#[allow(dead_code)]
struct TaskJob<T: Task> {
data: T
_data: T
}

impl<T: Task> TaskJob<T> {
Expand Down
5 changes: 2 additions & 3 deletions rayon-core/src/scope/internal.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#[cfg(rayon_unstable)]
#![cfg(rayon_unstable)]

use internal::task::{ScopeHandle, ToScopeHandle, Task};
use std::any::Any;
use std::mem;
use std::sync::Arc;
use super::Scope;

#[cfg(rayon_unstable)]
impl<'scope> ToScopeHandle<'scope> for Scope<'scope> {
type ScopeHandle = LocalScopeHandle<'scope>;

Expand Down Expand Up @@ -42,7 +42,6 @@ impl<'scope> Drop for LocalScopeHandle<'scope> {
/// We assert that the `Self` type remains valid until a
/// method is called, and that `'scope` will not end until
/// that point.
#[cfg(rayon_unstable)]
unsafe impl<'scope> ScopeHandle<'scope> for LocalScopeHandle<'scope> {
unsafe fn spawn_task<T: Task + 'scope>(&self, task: Arc<T>) {
let scope = &*self.scope;
Expand Down
2 changes: 0 additions & 2 deletions rayon-core/src/spawn/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#[allow(unused_imports)]
use latch::{Latch, SpinLatch};
use job::*;
use registry::Registry;
use std::mem;
Expand Down
5 changes: 2 additions & 3 deletions rayon-core/src/thread_pool/internal.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#[cfg(rayon_unstable)]
#![cfg(rayon_unstable)]

use internal::task::{ScopeHandle, ToScopeHandle, Task};
use registry::Registry;
use std::any::Any;
use std::fmt;
use std::sync::Arc;
use super::ThreadPool;

#[cfg(rayon_unstable)]
impl ToScopeHandle<'static> for ThreadPool {
type ScopeHandle = ThreadPoolScopeHandle;

Expand Down Expand Up @@ -52,7 +52,6 @@ impl Drop for ThreadPoolScopeHandle {
/// (b) the lifetime `'static` will not end until a completion
/// method is called. This is true because `'static` doesn't
/// end until the end of the program.
#[cfg(rayon_unstable)]
unsafe impl ScopeHandle<'static> for ThreadPoolScopeHandle {
unsafe fn spawn_task<T: Task + 'static>(&self, task: Arc<T>) {
self.registry.submit_task(task);
Expand Down
2 changes: 0 additions & 2 deletions rayon-core/src/thread_pool/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use Configuration;
#[allow(unused_imports)]
use log::Event::*;
use join;
use {scope, Scope};
use spawn;
Expand Down
2 changes: 0 additions & 2 deletions rayon-demo/src/tsp/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
//! Based on code developed at ETH by Christoph von Praun, Florian
//! Schneider, Nicholas Matsakis, and Thomas Gross.

#![allow(dead_code)]

use docopt::Docopt;
use std::error::Error;
use std::fs::File;
Expand Down
9 changes: 0 additions & 9 deletions rayon-demo/src/tsp/weight.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ impl Weight {
pub fn to_priority(self) -> Priority {
Priority { priority: usize::MAX - self.weight }
}

pub fn average(self, w: Weight) -> Weight {
if self < w {
let half_diff = (w.weight - self.weight) / 2;
Weight::new(self.weight + half_diff)
} else {
w.average(self)
}
}
}

impl Add for Weight {
Expand Down
2 changes: 1 addition & 1 deletion rayon-futures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ rayon-core = { version = "1.2.2", path = "../rayon-core" }
futures = "0.1.7"

[dev-dependencies]
compiletest_rs = "0.2.1"
compiletest_rs = "0.3"
2 changes: 1 addition & 1 deletion rayon-futures/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use rayon_core::{scope, ThreadPool, Configuration};
use super::ScopeFutureExt;

fn run_compiletest(mode: &str, path: &str) {
let mut config = compiletest::default_config();
let mut config = compiletest::Config::default();
config.mode = mode.parse().ok().expect("Invalid mode");
config.src_base = PathBuf::from(path);
config.target_rustcflags = Some("-L ../target/debug/ -L ../target/debug/deps/".to_owned());
Expand Down
1 change: 0 additions & 1 deletion src/iter/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//! See `README.md` for a high-level overview.

use join_context;
use FnContext;

use super::IndexedParallelIterator;

Expand Down
5 changes: 0 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
#![cfg_attr(test, feature(conservative_impl_trait))]
#![cfg_attr(test, feature(i128_type))]

// If you're not compiling the unstable code, it often happens that
// there is stuff that is considered "dead code" and so forth. So
// disable warnings in that scenario.
#![cfg_attr(not(rayon_unstable), allow(warnings))]

//! Data-parallelism library that is easy to convert sequential computations into parallel.
//!
//! Rayon is lightweight and convenient for application to existing code. It guarantees
Expand Down
1 change: 0 additions & 1 deletion src/slice/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

use rand::{thread_rng, Rng};
use std::cmp::Ordering::{Equal, Greater, Less};
use std::mem;
use super::ParallelSliceMut;

macro_rules! sort {
Expand Down
2 changes: 1 addition & 1 deletion src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate compiletest_rs as compiletest;
use std::path::PathBuf;

fn run_compiletest(mode: &str, path: &str) {
let mut config = compiletest::default_config();
let mut config = compiletest::Config::default();
config.mode = mode.parse().ok().expect("Invalid mode");
config.src_base = PathBuf::from(path);
config.target_rustcflags = Some("-L target/debug/ -L target/debug/deps/".to_owned());
Expand Down