Skip to content

compiler error E0505 example compiles with 2018 edition #58586

Closed
@gurgalex

Description

@gurgalex
Contributor

Activity

gurgalex

gurgalex commented on Feb 20, 2019

@gurgalex
ContributorAuthor

Where are the error code examples in the repo?

changed the title [-]compiler error E505 example compiles with 2018 edition[/-] [+]compiler error E0505 example compiles with 2018 edition[/+] on Feb 20, 2019
hellow554

hellow554 commented on Feb 20, 2019

@hellow554
Contributor

E0505: r##"
A value was moved out while it was still borrowed.
Erroneous code example:
```compile_fail,E0505
struct Value {}
fn eat(val: Value) {}
fn main() {
let x = Value{};
{
let _ref_to_val: &Value = &x;
eat(x);
}
}
```

added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
and removed
A-diagnosticsArea: Messages for errors, warnings, and lints
on Feb 20, 2019
gurgalex

gurgalex commented on Feb 20, 2019

@gurgalex
ContributorAuthor

Which part do I need to build for rustc --explain E0505 to reflect changes in rust/src/librustc_mir/diagnostics.rs?

added a commit that references this issue on Feb 20, 2019

Fixes rust-lang#58586: Make E0505 explain example fail for 2018 edition

b2a02c8
zackmdavis

zackmdavis commented on Feb 20, 2019

@zackmdavis
Member

I think a stage 1 build should be fine? ./x.py build -i --stage 1 src/libtest

added a commit that references this issue on Feb 22, 2019

Rollup merge of rust-lang#58607 - gurgalex:fail_E0505_for_2018_editio…

30b69c5
added a commit that references this issue on Feb 22, 2019

Rollup merge of rust-lang#58607 - gurgalex:fail_E0505_for_2018_editio…

59f1a56

3 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @Centril@hellow554@zackmdavis@estebank@gurgalex

      Issue actions

        compiler error E0505 example compiles with 2018 edition · Issue #58586 · rust-lang/rust