about summary refs log tree commit diff
path: root/src/test/ui/unsafe
AgeCommit message (Collapse)AuthorLines
2021-01-16Auto merge of #80290 - RalfJung:less-intrinsic-write, r=lcnrbors-21/+0
implement ptr::write without dedicated intrinsic This makes `ptr::write` more consistent with `ptr::write_unaligned`, `ptr::read`, `ptr::read_unaligned`, all of which are implemented in terms of `copy_nonoverlapping`. This means we can also remove `move_val_init` implementations in codegen and Miri, and its special handling in the borrow checker. Also see [this Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/ptr.3A.3Aread.20vs.20ptr.3A.3Awrite).
2021-01-01Allow references to interior mutable data behind a feature gateoli-5/+11
2020-12-31remove move_val_init leftoversRalf Jung-21/+0
2020-09-29Bless testsDylan MacKenzie-4/+4
2020-09-23Bless testsDylan MacKenzie-7/+7
2020-09-22Bless testsDylan MacKenzie-2/+2
2020-09-02pretty: trim paths of unique symbolsDan Aloni-3/+3
If a symbol name can only be imported from one place for a type, and as long as it was not glob-imported anywhere in the current crate, we can trim its printed path and print only the name. This has wide implications on error messages with types, for example, shortening `std::vec::Vec` to just `Vec`, as long as there is no other `Vec` importable anywhere. This adds a new '-Z trim-diagnostic-paths=false' option to control this feature. On the good path, with no diagnosis printed, we should try to avoid issuing this query, so we need to prevent trimmed_def_paths query on several cases. This change also relies on a previous commit that differentiates between `Debug` and `Display` on various rustc types, where the latter is trimmed and presented to the user and the former is not.
2020-07-01Insert NoDelim groups around nonterminals when lowering macro_rulesAaron Hill-0/+16
2020-06-19Remove the const_raw_ptr_comparison feature gate.Oliver Scherer-8/+8
We can never supply a meaningful implementation of this. Instead, the follow up commits will create two intrinsics that approximate comparisons: * `ptr_maybe_eq` * `ptr_maybe_ne` The fact that `ptr_maybe_eq(a, b)` is not necessarily the same value as `!ptr_maybe_ne(a, b)` is a symptom of this entire problem.
2020-05-27Add tests for packed borrows in unsafe fnsLeSeulArtichaut-82/+140
2020-05-27Fix and bless testsLeSeulArtichaut-21/+168
2020-05-27Add more cases to the testLeSeulArtichaut-2/+28
2020-05-27Apply suggestions from code reviewLeSeulArtichaut-2/+23
2020-05-27Add testsLeSeulArtichaut-0/+55
2020-05-26Rollup merge of #72401 - ecstatic-morse:issue-72394, r=eddybDylan DPC-0/+24
Use correct function for detecting `const fn` in unsafety checking Resolves #72394.
2020-05-20Add regression test for #72394Dylan MacKenzie-0/+24
2020-05-19Remove dangling COPYRIGHT referencesTamir Duberstein-5/+1
Missed in 2a663555ddf36f6b041445894a8c175cd1bc718c.
2020-03-10more reuse in block parsing & improve diagnostics.Mazdak Farrokhzad-3/+4
2020-02-13parser: fuse free `fn` parsing together.Mazdak Farrokhzad-3/+3
2020-02-09--bless --compare-mode=nllMatthias Prechtl-2/+2
2020-01-24Normalise notes with the/isvarkor-1/+1
2019-11-23Highlight parts of fn in type errorsEsteban Küber-6/+6
When a type error arises between two fn items, fn pointers or tuples, highlight only the differing parts of each.
2019-11-18Specific labels when referring to "expected" and "found" typesEsteban Küber-6/+6
2019-11-06Remove "here" from "expected one of X here"Esteban Küber-1/+1
2019-07-06normalize use of backticks/lowercase in compiler messages for librustc_mirSamy Kacimi-2/+2
https://github.com/rust-lang/rust/issues/60532 r? @alexreg
2019-04-23Auto merge of #60125 - estebank:continue-evaluating, r=oli-obkbors-2/+4
Don't stop evaluating due to errors before borrow checking r? @oli-obk Fix #60005. Follow up to #59903. Blocked on #53708, fixing the ICE in `src/test/ui/consts/match_ice.rs`.
2019-04-22Never stop due to errors before borrow checkingEsteban Küber-2/+4
2019-04-22Remove double trailing newlinesvarkor-1/+0
2019-04-18hide `--explain` hint if error has no extended infoAndy Russell-2/+2
2019-03-11Update testsVadim Petrochenkov-17/+17
2019-02-14Update const fn testsvarkor-3/+8
2019-01-09const fn feature gate is not needed anymore in a lot of testsOliver Scherer-16/+15
2019-01-09Stabilize `let` bindings and destructuring in constants and const fnOliver Scherer-3/+3
2018-12-25Remove licensesMark Rousskov-123/+12
2018-12-18Fix string for raw pointer deref suggestionvarkor-1/+3
2018-12-18Replace "native pointer" in error message with "raw pointer"varkor-1/+1
2018-12-04Add and update testsOliver Scherer-22/+5
2018-12-04Add tests for stable unsafe features in const fnOliver Scherer-0/+158
2018-12-04Also prevent mutation fields directlyOliver Scherer-10/+30
2018-12-04Also make immutable references to non-freeze restricted value range types unsafeOliver Scherer-0/+22
2018-12-04generalize the message about the creation of layout restricted typesOliver Scherer-1/+1
2018-12-04Trailing newlines againOliver Scherer-2/+2
2018-12-04Forbid the creation of mutable borrows to fields of layout constrained typesOliver Scherer-0/+39
2018-10-05Stabilize `min_const_fn`Oliver Schneider-3/+1
2018-08-31Restrict most uses of `const_fn` to `min_const_fn`Oliver Schneider-1/+1
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+353