mirror of
https://github.com/rust-lang/rust-clippy
synced 2025-02-17 06:28:42 +00:00
Merge pull request #2436 from messense/rustup
Rustup to rustc 1.25.0-nightly (0c6091fbd 2018-02-04)
This commit is contained in:
commit
02830187cc
1 changed files with 5 additions and 3 deletions
|
@ -9,7 +9,7 @@ use rustc::lint::{LateContext, Level, Lint, LintContext};
|
|||
use rustc::session::Session;
|
||||
use rustc::traits;
|
||||
use rustc::ty::{self, Ty, TyCtxt};
|
||||
use rustc::ty::layout::{LayoutOf, Align};
|
||||
use rustc::ty::layout::Align;
|
||||
use rustc_errors;
|
||||
use std::borrow::Cow;
|
||||
use std::env;
|
||||
|
@ -1038,7 +1038,7 @@ pub fn is_try(expr: &Expr) -> Option<&Expr> {
|
|||
}
|
||||
|
||||
pub fn type_size<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> Option<u64> {
|
||||
(cx.tcx, cx.param_env).layout_of(ty)
|
||||
cx.tcx.layout_of(cx.param_env.and(ty))
|
||||
.ok()
|
||||
.map(|layout| layout.size.bytes())
|
||||
}
|
||||
|
@ -1060,5 +1060,7 @@ pub fn get_arg_name(pat: &Pat) -> Option<ast::Name> {
|
|||
|
||||
/// Returns alignment for a type, or None if alignment is undefined
|
||||
pub fn alignment<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> Option<Align> {
|
||||
(cx.tcx, cx.param_env).layout_of(ty).ok().map(|layout| layout.align)
|
||||
cx.tcx.layout_of(cx.param_env.and(ty))
|
||||
.ok()
|
||||
.map(|layout| layout.align)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue