Update tests; make it work with generics on context
This commit is contained in:
parent
b0616df931
commit
09143cdaf0
2 changed files with 6 additions and 31 deletions
|
|
@ -108,13 +108,12 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
|
|||
// can't be implemented by default
|
||||
return;
|
||||
}
|
||||
//TODO: There is no sig.generics anymore and I don't know how to fix this.
|
||||
//if !sig.generics.ty_params.is_empty() {
|
||||
// // when the result of `new()` depends on a type parameter we should not require
|
||||
// // an
|
||||
// // impl of `Default`
|
||||
// return;
|
||||
//}
|
||||
if !cx.generics.expect("method must have generics").ty_params.is_empty() {
|
||||
// when the result of `new()` depends on a type parameter we should not require
|
||||
// an
|
||||
// impl of `Default`
|
||||
return;
|
||||
}
|
||||
if decl.inputs.is_empty() && name == "new" && cx.access_levels.is_reachable(id) {
|
||||
let self_ty = cx.tcx
|
||||
.type_of(cx.tcx.hir.local_def_id(cx.tcx.hir.get_parent(id)));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue