summary refs log tree commit diff
path: root/compiler/rustc_transmute/src
AgeCommit message (Collapse)AuthorLines
2022-09-04Auto merge of #100726 - jswrenn:transmute, r=oli-obkbors-16/+59
safe transmute: use `Assume` struct to provide analysis options This task was left as a TODO in #92268; resolving it brings [`BikeshedIntrinsicFrom`](https://doc.rust-lang.org/nightly/core/mem/trait.BikeshedIntrinsicFrom.html) more in line with the API defined in [MCP411](https://github.com/rust-lang/compiler-team/issues/411). **Before:** ```rust pub unsafe trait BikeshedIntrinsicFrom< Src, Context, const ASSUME_ALIGNMENT: bool, const ASSUME_LIFETIMES: bool, const ASSUME_VALIDITY: bool, const ASSUME_VISIBILITY: bool, > where Src: ?Sized, {} ``` **After:** ```rust pub unsafe trait BikeshedIntrinsicFrom<Src, Context, const ASSUME: Assume = { Assume::NOTHING }> where Src: ?Sized, {} ``` `Assume::visibility` has also been renamed to `Assume::safety`, as library safety invariants are what's actually being assumed; visibility is just the mechanism by which it is currently checked (and that may change). r? `@oli-obk` --- Related: - https://github.com/rust-lang/compiler-team/issues/411 - https://github.com/rust-lang/rust/issues/99571
2022-09-01Always import all tracing macros for the entire crate instead of piecemeal ↵Oli Scherer-11/+11
by module
2022-08-31safe transmute: use `to_valtree` to destructure const `Assume`Jack Wrenn-7/+4
ref: https://github.com/rust-lang/rust/pull/100726#discussion_r954813220
2022-08-31Fix a bunch of typoDezhi Wu-1/+1
This PR will fix some typos detected by [typos]. I only picked the ones I was sure were spelling errors to fix, mostly in the comments. [typos]: https://github.com/crate-ci/typos
2022-08-26Rollup merge of #100604 - dtolnay:okorerr, r=m-ou-seYuki Okushi-16/+11
Remove unstable Result::into_ok_or_err Pending FCP: https://github.com/rust-lang/rust/issues/82223#issuecomment-1214920203 ```@rustbot``` label +waiting-on-fcp
2022-08-23safe transmute: use `FxIndex{Map,Set}` instead of `FxHash{Map,Set}`Jack Wrenn-12/+1
resolves query instability issues, and probably better for performance
2022-08-22safe transmute: use `Assume` struct to provide analysis optionsJack Wrenn-4/+61
This was left as a TODO in #92268, and brings the trait more in line with what was defined in MCP411. `Assume::visibility` has been renamed to `Assume::safety`, as library safety is what's actually being assumed; visibility is just the mechanism by which it is currently checked (this may change). ref: https://github.com/rust-lang/compiler-team/issues/411 ref: https://github.com/rust-lang/rust/issues/99571
2022-08-21ADD - diagnostic lints to rustc_transmuteJhonny Bill Mena-0/+2
Module is complete because it has zero diagnostics.
2022-08-17Replace a try_fold in rustc_transmute to use ControlFlow instead of ResultDavid Tolnay-3/+4
2022-08-17Remove unstable Result::into_ok_or_errDavid Tolnay-14/+8
2022-08-02safe transmute: fix broken intradoc linkJack Wrenn-2/+2
2022-07-28safe transmute: use `AtomicU32` `State` ids to appease mipsJack Wrenn-6/+6
...instead of `AtomicU64`, which is unavailable. ref: https://github.com/rust-lang/rust/pull/92268#issuecomment-1197797990
2022-07-27safe transmute: lowercase tracing levelsJack Wrenn-6/+6
ref: https://github.com/rust-lang/rust/pull/92268#discussion_r927095154
2022-07-27safe transmute: tweak `Nfa::union` to consume params by valueJack Wrenn-2/+2
ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925274516
2022-07-27safe transmute: tweak tracingJack Wrenn-21/+16
ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925246903 ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925250811 ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925255782
2022-07-27Initial (incomplete) implementation of transmutability trait.Jack Wrenn-0/+1635
This initial implementation handles transmutations between types with specified layouts, except when references are involved. Co-authored-by: Igor null <m1el.2027@gmail.com>