rust/tests/ui/wf/wf-misc-methods-issue-28609.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.9 KiB
Plaintext
Raw Normal View History

error[E0515]: cannot return value referencing temporary value
--> $DIR/wf-misc-methods-issue-28609.rs:22:5
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | s.transmute_inherent(&mut 42)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^--^
| | |
| | temporary value created here
| returns a value referencing data owned by the current function
2018-08-08 12:28:26 +00:00
error[E0515]: cannot return value referencing local variable `four`
--> $DIR/wf-misc-methods-issue-28609.rs:36:5
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | s.bomb = Some(&four);
| ----- `four` is borrowed here
2018-08-08 12:28:26 +00:00
LL | &s
| ^^ returns a value referencing data owned by the current function
2018-08-08 12:28:26 +00:00
error[E0515]: cannot return value referencing local variable `four`
--> $DIR/wf-misc-methods-issue-28609.rs:43:5
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | s.bomb = Some(&four);
| ----- `four` is borrowed here
2018-08-08 12:28:26 +00:00
LL | &*s
| ^^^ returns a value referencing data owned by the current function
2018-08-08 12:28:26 +00:00
error[E0515]: cannot return value referencing temporary value
--> $DIR/wf-misc-methods-issue-28609.rs:53:5
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | s << &mut 3
| ^^^^^^^^^^-
| | |
| | temporary value created here
| returns a value referencing data owned by the current function
2018-08-08 12:28:26 +00:00
error[E0515]: cannot return value referencing temporary value
--> $DIR/wf-misc-methods-issue-28609.rs:58:5
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | s.shl(&mut 3)
| ^^^^^^^^^^^-^
| | |
| | temporary value created here
| returns a value referencing data owned by the current function
2018-08-08 12:28:26 +00:00
error[E0515]: cannot return value referencing temporary value
--> $DIR/wf-misc-methods-issue-28609.rs:63:5
2018-08-08 12:28:26 +00:00
|
2019-03-09 12:03:44 +00:00
LL | S2::shl(s, &mut 3)
| ^^^^^^^^^^^^^^^^-^
| | |
| | temporary value created here
| returns a value referencing data owned by the current function
2018-08-08 12:28:26 +00:00
error: aborting due to 6 previous errors
For more information about this error, try `rustc --explain E0515`.