Skip to content

Improve transmute diagnostics, register missing privacy/trans diagnostics #29980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 22, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/librustc/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,9 @@ It is also possible to manually transmute:
```
ptr::read(&v as *const _ as *const SomeType) // `v` transmuted to `SomeType`
```

Note that this does not move `v` (unlike `transmute`), and may need a
call to `mem::forget(v)` in case you want to avoid destructors being called.
"##,

E0152: r##"
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_driver/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -907,6 +907,8 @@ pub fn diagnostics_registry() -> diagnostics::registry::Registry {
all_errors.push_all(&rustc_typeck::DIAGNOSTICS);
all_errors.push_all(&rustc_borrowck::DIAGNOSTICS);
all_errors.push_all(&rustc_resolve::DIAGNOSTICS);
all_errors.push_all(&rustc_privacy::DIAGNOSTICS);
all_errors.push_all(&rustc_trans::DIAGNOSTICS);

Registry::new(&*all_errors)
}
Expand Down
2 changes: 2 additions & 0 deletions src/librustc_privacy/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1505,3 +1505,5 @@ pub fn check_crate(tcx: &ty::ctxt,

access_levels
}

__build_diagnostic_array! { librustc_privacy, DIAGNOSTICS }
2 changes: 2 additions & 0 deletions src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ pub mod save;
pub mod lib {
pub use llvm;
}

__build_diagnostic_array! { librustc_trans, DIAGNOSTICS }