Commit Graph

45 Commits

Author SHA1 Message Date
oli d118021f8b Permit mutable references in all const contexts 2021-01-23 11:33:45 +00:00
Caio 2055e4c2fa Move some tests to more reasonable directories 2021-01-11 19:49:51 -03:00
Vadim Petrochenkov 4d2d0bad4e Remove `compile-fail` test suite 2020-12-29 23:39:56 +03:00
bors ec039bd075 Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obk
Rename `optin_builtin_traits` to `auto_traits`

They were originally called "opt-in, built-in traits" (OIBITs), but
people realized that the name was too confusing and a mouthful, and so
they were renamed to just "auto traits". The feature flag's name wasn't
updated, though, so that's what this PR does.

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.

r? `@oli-obk` (feel free to re-assign if you're not the right reviewer for this)
2020-11-25 07:25:19 +00:00
Camelid 810324d1f3 Rename `optin_builtin_traits` to `auto_traits`
They were originally called "opt-in, built-in traits" (OIBITs), but
people realized that the name was too confusing and a mouthful, and so
they were renamed to just "auto traits". The feature flag's name wasn't
updated, though, so that's what this PR does.

There are some other spots in the compiler that still refer to OIBITs,
but I don't think changing those now is worth it since they are internal
and not particularly relevant to this PR.

Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
2020-11-23 14:14:06 -08:00
Lzu Tao 6bfe27a3e0 Drop support for cloudabi targets 2020-11-22 17:11:41 -05:00
Matthew Jasper 5b279c8016 Check opaque types satisfy their bounds 2020-10-06 11:19:30 +01:00
Matthew Jasper f958e6c246 Separate bounds and predicates for associated/opaque types 2020-10-06 11:19:29 +01:00
Dan Aloni 07e7823c01 pretty: trim paths of unique symbols
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-09-02 22:26:37 +03:00
Yuki Okushi 43ef554b6a
Add test for issue-51506 2020-06-23 17:52:26 +09:00
Yuki Okushi 9a164ff4c5
Skip tests on emscripten 2020-05-08 00:39:02 +09:00
Yuki Okushi e69748ba4f
Move tests from `test/run-fail` to UI 2020-05-06 14:02:55 +09:00
RoccoDev b85c64c3ea
rustc: Add a warning count upon completion 2020-04-11 16:15:24 +02:00
Esteban Küber d605a9d969 Small tweaks to required bound span 2020-04-08 14:40:51 -07:00
Niko Matsakis fda3378e3f introduce `negative_impls` feature gate and document
They used to be covered by `optin_builtin_traits` but negative impls
are now applicable to all traits, not just auto traits.

This also adds docs in the unstable book for the current state of auto traits.
2020-03-26 06:52:55 -04:00
Alex Tokarev b35c30251f Reword unused variable warning 2020-03-23 12:14:45 +03:00
Ralf Jung 503026b622 mem::zeroed/uninit: panic on types that do not permit zero-initialization 2020-02-29 09:27:25 +01:00
Esteban Küber c764a82310 keep predicate order and tweak output 2020-02-28 11:37:59 -08:00
Esteban Küber 1e7bcc733a Tweak wording 2020-02-28 11:37:59 -08:00
Esteban Küber 0387f0d19b Mention the full path of the implementing trait 2020-02-28 11:37:59 -08:00
Esteban Küber 8993b99ae2 On single local candidate, use span label 2020-02-28 11:37:58 -08:00
Matthias Prechtl 7b555178ae --bless --compare-mode=nll 2020-02-09 20:43:49 +01:00
Eduard-Mihai Burtescu 4c7eb59e81 rustc_macros: don't limit the -Zmacro-backtrace suggestion to extern macros. 2020-02-06 21:46:38 +02:00
Eduard-Mihai Burtescu f6fc80206e rustc: rename -Zexternal-macro-backtrace to -Zmacro-backtrace. 2020-02-06 21:32:07 +02:00
bors 5371ddf8c6 Auto merge of #68080 - varkor:declared-here, r=petrochenkov
Address inconsistency in using "is" with "declared here"

"is" was generally used for NLL diagnostics, but not other diagnostics. Using "is" makes the diagnostics sound more natural and readable, so it seems sensible to commit to them throughout.

r? @Centril
2020-01-31 15:13:51 +00:00
Esteban Küber d14a323e74 Use more accurate return path spans
No longer suggest `Box::new(if foo { Type1 } else { Type2 })`, instead
suggesting `if foo { Box::new(Type1) } else { Box::new(Type2) }`.
2020-01-24 10:35:13 -08:00
varkor 24a2929ed1 Normalise notes with the/is 2020-01-24 16:24:50 +00:00
Esteban Küber 5b36c187dc review comments 2020-01-16 09:49:13 -08:00
Esteban Küber e1dd8a9095 When trait bounds are missing for return values, point at them 2020-01-16 09:37:24 -08:00
Esteban Küber 2c5766f2d4 Unify output of "variant not found" errors 2020-01-08 08:05:31 -08:00
Niko Matsakis 405eefe467 add `#![feature(never_type)]` to tests as needed 2019-12-14 09:01:18 -05:00
Niko Matsakis dc49b2cdfd Add regression test for #66757 2019-12-14 09:01:13 -05:00
Niko Matsakis 1719337d02 Revert "Remove `#![feature(never_type)]` from tests."
This reverts commit 8f6197f39f.
2019-12-14 09:01:04 -05:00
Esteban Küber 34f03c01f6 Point at type in `let` assignment on type errors 2019-11-21 19:24:31 -08:00
bors 53712f8637 Auto merge of #66389 - estebank:type-err-labels, r=petrochenkov
Specific labels when referring to "expected" and "found" types
2019-11-21 17:53:19 +00:00
Mazdak Farrokhzad 238d03b3a3 never_type: test interaction with auto traits 2019-11-21 15:09:18 +01:00
Mazdak Farrokhzad 6eb0627b49 Gate fallback via `#![feature(never_type_fallback)]`. 2019-11-21 14:55:33 +01:00
Mazdak Farrokhzad 8f6197f39f Remove `#![feature(never_type)]` from tests.
Also remove `never_type` the feature-gate test.
2019-11-21 14:55:32 +01:00
Esteban Küber 6f8f70624b Surround types with backticks in type errors 2019-11-18 11:03:04 -08:00
Esteban Küber 94c6425464 Remove E0308 note when primary label has all info 2019-11-18 11:03:03 -08:00
Esteban Küber 83ffda5216 Specific labels when referring to "expected" and "found" types 2019-11-18 11:02:22 -08:00
Tomasz Miąsko cfa2a2632a Use check-pass for never type tests 2019-11-03 10:20:11 +01:00
Thomas Lively 62c3443e96 Re-enable Emscripten's exception handling support
Passes LLVM codegen and Emscripten link-time flags for exception
handling if and only if the panic strategy is `unwind`. Sets the
default panic strategy for Emscripten targets to `unwind`. Re-enables
tests that depend on unwinding support for Emscripten, including
`should_panic` tests.
2019-10-25 15:16:36 -07:00
Thomas Lively 2bf59bea48 Upgrade Emscripten targets to use upstream LLVM backend
- Compatible with Emscripten 1.38.46-upstream or later upstream.
 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the old incorrect wasm32 C call ABI with the correct one,
   preserving the old one as wasm32_bindgen_compat for wasm-bindgen
   compatibility.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-16 17:06:48 -07:00
Mazdak Farrokhzad 1fb8cfb481 Organize `never_type` tests
Also move {run-fail -> ui}/never_type
2019-10-15 16:58:14 +02:00