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

bump: rust 1.47 #279

Merged
merged 1 commit into from
Oct 10, 2020
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
10 changes: 2 additions & 8 deletions crates/mun_abi/src/type_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,18 +104,12 @@ unsafe impl Sync for TypeInfo {}
impl TypeGroup {
/// Returns whether this is a fundamental type.
pub fn is_fundamental(self) -> bool {
match self {
TypeGroup::FundamentalTypes => true,
_ => false,
}
self == TypeGroup::FundamentalTypes
}

/// Returns whether this is a struct type.
pub fn is_struct(self) -> bool {
match self {
TypeGroup::StructTypes => true,
_ => false,
}
self == TypeGroup::StructTypes
}
}

Expand Down
5 changes: 1 addition & 4 deletions crates/mun_compiler/src/driver/display_color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@ impl DisplayColor {
/// Decides whether the current terminal supports ANSI escape codes based on the `term` environment variable and the operating system.
fn terminal_support_ansi() -> bool {
let supports_color = match env::var("TERM") {
Ok(terminal) => match terminal.as_str() {
"dumb" => false,
_ => true,
},
Ok(terminal) => terminal.as_str() == "dumb",
Err(_) => {
#[cfg(target_os = "windows")]
let term_support = cmd_supports_ansi();
Expand Down
1 change: 1 addition & 0 deletions crates/mun_hir/src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ pub fn resolver_for_expr(body: Arc<Body>, db: &dyn HirDatabase, expr_id: ExprId)
resolver_for_scope(body, db, scopes.scope_for(expr_id))
}

#[allow(clippy::needless_collect)] // false positive https://github.com/rust-lang/rust-clippy/issues/5991
pub(crate) fn resolver_for_scope(
body: Arc<Body>,
db: &dyn HirDatabase,
Expand Down
10 changes: 2 additions & 8 deletions crates/mun_hir/src/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,7 @@ impl Ty {
}

pub fn is_never(&self) -> bool {
match self.as_simple() {
Some(TypeCtor::Never) => true,
_ => false,
}
self.as_simple() == Some(TypeCtor::Never)
}

/// Returns the callable definition for the given expression or `None` if the type does not
Expand Down Expand Up @@ -185,10 +182,7 @@ impl Ty {

/// Returns true if this instance represents a known type.
pub fn is_known(&self) -> bool {
match self {
Ty::Unknown => false,
_ => true,
}
*self == Ty::Unknown
}
}

Expand Down
10 changes: 2 additions & 8 deletions crates/mun_hir/src/ty/lower.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,17 +182,11 @@ impl_froms!(CallableDef: Function, Struct);

impl CallableDef {
pub fn is_function(self) -> bool {
match self {
CallableDef::Function(_) => true,
_ => false,
}
matches!(self, CallableDef::Function(_))
}

pub fn is_struct(self) -> bool {
match self {
CallableDef::Struct(_) => true,
_ => false,
}
matches!(self, CallableDef::Struct(_))
}
}

Expand Down
8 changes: 4 additions & 4 deletions crates/mun_syntax/src/ast/extensions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ impl ast::PathSegment {
}

pub fn has_colon_colon(&self) -> bool {
match self.syntax.first_child_or_token().map(|s| s.kind()) {
Some(T![::]) => true,
_ => false,
}
matches!(
self.syntax.first_child_or_token().map(|s| s.kind()),
Some(T![::])
)
}
}

Expand Down
Loading