Skip to content

Commit 9fd3860

Browse files
author
gralpli
committed
Fix ICE when compiling fn f<T: ?for<'a> Sized>() {}
1 parent 45b273a commit 9fd3860

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

Diff for: src/librustc_typeck/collect.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1665,7 +1665,6 @@ fn is_unsized<'gcx: 'tcx, 'tcx>(astconv: &AstConv<'gcx, 'tcx>,
16651665
for ab in ast_bounds {
16661666
if let &hir::TraitTyParamBound(ref ptr, hir::TraitBoundModifier::Maybe) = ab {
16671667
if unbound.is_none() {
1668-
assert!(ptr.bound_lifetimes.is_empty());
16691668
unbound = Some(ptr.trait_ref.clone());
16701669
} else {
16711670
span_err!(tcx.sess, span, E0203,

Diff for: src/test/run-pass/issue-39089.rs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn f<T: ?for<'a> Sized>() {}
12+
13+
fn main() {}

0 commit comments

Comments
 (0)