Skip to content

Commit 7577b6b

Browse files
committed
rollup merge of #18383 : bkoropoff/issue-17361
2 parents 88946f7 + 374da5b commit 7577b6b

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/librustc/middle/typeck/astconv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ fn mk_pointer<'tcx, AC: AstConv<'tcx>, RS: RegionScope>(
674674
return constr(ty::mk_str(tcx));
675675
}
676676
RPtr(r) => {
677-
return ty::mk_str_slice(tcx, r, ast::MutImmutable);
677+
return ty::mk_str_slice(tcx, r, a_seq_mutbl);
678678
}
679679
}
680680
}

src/test/run-pass/issue-17361.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright 2014 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+
// Test that astconv doesn't forget about mutability of &mut str
12+
13+
fn main() {
14+
fn foo<Sized? T>(_: &mut T) {}
15+
let _f: fn(&mut str) = foo;
16+
}

0 commit comments

Comments
 (0)