14:13.07 error[E0506]: cannot assign to self.input.cached_token because it is borrowed
14:13.07 --> /builddir/build/BUILD/thunderbird-68.1.1/third_party/rust/cssparser/src/parser.rs:584:17
14:13.07 |
14:13.07 559 | pub fn next_including_whitespace_and_comments(&mut self) -> Result<&Token<'i>, BasicParseError<'i>> {
14:13.07 | - let's call the lifetime of this reference '1
14:13.07 ...
14:13.07 572 | Some(ref cached_token)
14:13.07 | ---------------- borrow of self.input.cached_token occurs here
14:13.07 ...
14:13.07 584 | self.input.cached_token = Some(CachedToken {
14:13.07 | ^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed self.input.cached_token occurs here
14:13.07 ...
14:13.07 596 | Ok(token)
14:13.07 | --------- returning this value requires that self.input.cached_token.0 is borrowed for '1
14:13.80 error: aborting due to previous error
14:13.80 For more information about this error, try rustc --explain E0506.
14:13.83 error: Could not compile cssparser.
14:13.83 warning: build failed, waiting for other jobs to finish...
With Rust 1.37, that same code gave a compatibility warning:
warning[E0506]: cannot assign to `self.input.cached_token` because it is borrowed
--> src/parser.rs:584:17
|
559 | pub fn next_including_whitespace_and_comments(&mut self) -> Result<&Token<'i>, BasicParseError<'i>> {
| - let's call the lifetime of this reference `'1`
...
572 | Some(ref cached_token)
| ---------------- borrow of `self.input.cached_token` occurs here
...
584 | self.input.cached_token = Some(CachedToken {
| ^^^^^^^^^^^^^^^^^^^^^^^ assignment to borrowed `self.input.cached_token` occurs here
...
596 | Ok(token)
| --------- returning this value requires that `self.input.cached_token.0` is borrowed for `'1`
|
= warning: this error has been downgraded to a warning for backwards compatibility with previous releases
= warning: this represents potential undefined behavior in your code and this warning will become a hard error in the future
= note: for more information, try `rustc --explain E0729`
It looks like this was fixed in cssparser here:
https://github.com/servo/rust-cssparser/pull/245
1 Like
system
Closed
4
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.