d793766a61
This change `const`-qualifies many methods on Vec and String, notably `as_slice`, `as_str`, `len`. These changes are made behind the unstable feature flag `const_vec_string_slice` with the following tracking issue: https://github.com/rust-lang/rust/issues/129041
19 lines
371 B
Rust
19 lines
371 B
Rust
//@ known-bug: #103507
|
|
|
|
#![feature(const_trait_impl, const_vec_string_slice)]
|
|
|
|
struct Foo<'a> {
|
|
bar: &'a mut Vec<usize>,
|
|
}
|
|
|
|
impl<'a> Foo<'a> {
|
|
const fn spam(&mut self, baz: &mut Vec<u32>) {
|
|
self.bar[0] = baz.len();
|
|
//FIXME ~^ ERROR: cannot call
|
|
//FIXME ~| ERROR: cannot call
|
|
//FIXME ~| ERROR: the trait bound
|
|
}
|
|
}
|
|
|
|
fn main() {}
|