about summary refs log tree commit diff
path: root/src/test/ui/feature-gates
AgeCommit message (Collapse)AuthorLines
2021-04-08Rollup merge of #83689 - estebank:cool-bears-hot-tip, r=davidtwcoDylan DPC-1/+5
Add more info for common trait resolution and async/await errors * Suggest `Pin::new`/`Box::new`/`Arc::new`/`Box::pin` in more cases * Point at `impl` and type defs introducing requirements on E0277
2021-04-08Stablize `non_ascii_idents` feature.Charles Lew-164/+0
2021-04-07Rollup merge of #83954 - estebank:issue-83613, r=varkorDylan DPC-1/+1
Do not ICE when closure is involved in Trait Alias Impl Trait Fix #83613.
2021-04-06Point at `impl` and type defs introducing requirements on E0277Esteban Küber-1/+5
2021-04-07Disable using non-ascii identifiers in extern blocks.Charles Lew-1/+12
2021-04-06Remove trailing `:` from E0119 messageEsteban Küber-1/+1
2021-04-06Auto merge of #81234 - repnop:fn-alignment, r=lcnrbors-0/+16
Allow specifying alignment for functions Fixes #75072 This allows the user to specify alignment for functions, which can be useful for low level work where functions need to necessarily be aligned to a specific value. I believe the error cases not covered in the match are caught earlier based on my testing so I had them just return `None`.
2021-04-05Allow specifying alignment for functionsWesley Norris-0/+16
2021-04-05Rollup merge of #83820 - petrochenkov:nolinkargs, r=nagisaDylan DPC-47/+0
Remove attribute `#[link_args]` Closes https://github.com/rust-lang/rust/issues/29596 The attribute could always be replaced with `-C link-arg`, but cargo didn't provide a reasonable way to pass such flags to rustc. Now cargo supports `cargo:rustc-link-arg*` directives in build scripts (https://doc.rust-lang.org/cargo/reference/unstable.html#extra-link-arg), so this attribute can be removed.
2021-04-03Remove redundant `ignore-tidy-linelength` annotationsSimon Jakobi-328/+323
This is step 2 towards fixing #77548. In the codegen and codegen-units test suites, the `//` comment markers were kept in order not to affect any source locations. This is because these tests cannot be automatically `--bless`ed.
2021-04-03Remove attribute `#[link_args]`Vadim Petrochenkov-47/+0
2021-04-02Rollup merge of #83673 - hi-rustin:rustin-patch-suggestion, r=estebankDylan DPC-2/+2
give full path of constraint in suggest_constraining_type_param close https://github.com/rust-lang/rust/issues/83513
2021-04-02Auto merge of #80965 - camelid:rename-doc-spotlight, r=jyn514bors-16/+16
Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` Fixes #80936. "spotlight" is not a very specific or self-explaining name. Additionally, the dialog that it triggers is called "Notable traits". So, "notable trait" is a better name. * Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` * Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]` * Update documentation * Improve documentation r? `@Manishearth`
2021-03-31give full path of constraint in suggest_constraining_type_paramhi-rustin-2/+2
revert file bless with nll mode
2021-03-24resolve late lifetimes by itemJack Huey-84/+84
This reverts commit 22ae20733515d710c1134600bc1e29cdd76f6b9b.
2021-03-23Update testskadmin-2/+2
2021-03-22rename :pat2018 -> :pat215mark-5/+5
2021-03-15Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]`Camelid-16/+16
"spotlight" is not a very specific or self-explaining name. Additionally, the dialog that it triggers is called "Notable traits". So, "notable trait" is a better name. * Rename `#[doc(spotlight)]` to `#[doc(notable_trait)]` * Rename `#![feature(doc_spotlight)]` to `#![feature(doc_notable_trait)]` * Update documentation * Improve documentation
2021-03-15Only allow tait defining uses in function and method return positionOli Scherer-14/+19
2021-03-15Replace `type_alias_impl_trait` by `min_type_alias_impl_trait` with no ↵Oli Scherer-134/+244
actual changes in behaviour This makes `type_alias_impl_trait` not actually do anything anymore
2021-03-10Auto merge of #79519 - cjgillot:noattr, r=wesleywiserbors-97/+97
Store HIR attributes in a side table Same idea as #72015 but for attributes. The objective is to reduce incr-comp invalidations due to modified attributes. Notably, those due to modified doc comments. Implementation: - collect attributes during AST->HIR lowering, in `LocalDefId -> ItemLocalId -> &[Attributes]` nested tables; - access the attributes through a `hir_owner_attrs` query; - local refactorings to use this access; - remove `attrs` from HIR data structures one-by-one. Change in behaviour: - the HIR visitor traverses all attributes at once instead of parent-by-parent; - attribute arrays are sometimes duplicated: for statements and variant constructors; - as a consequence, attributes are marked as used after unused-attribute lint emission to avoid duplicate lints. ~~Current bug: the lint level is not correctly applied in `std::backtrace_rs`, triggering an unused attribute warning on `#![no_std]`. I welcome suggestions.~~
2021-03-10Rollup merge of #79208 - LeSeulArtichaut:stable-unsafe_op_in_unsafe_fn, ↵Yuki Okushi-36/+0
r=nikomatsakis Stabilize `unsafe_op_in_unsafe_fn` lint This makes it possible to override the level of the `unsafe_op_in_unsafe_fn`, as proposed in https://github.com/rust-lang/rust/issues/71668#issuecomment-729770896. Tracking issue: #71668 r? ```@nikomatsakis``` cc ```@SimonSapin``` ```@RalfJung``` # Stabilization report This is a stabilization report for `#![feature(unsafe_block_in_unsafe_fn)]`. ## Summary Currently, the body of unsafe functions is an unsafe block, i.e. you can perform unsafe operations inside. The `unsafe_op_in_unsafe_fn` lint, stabilized here, can be used to change this behavior, so performing unsafe operations in unsafe functions requires an unsafe block. For now, the lint is allow-by-default, which means that this PR does not change anything without overriding the lint level. For more information, see [RFC 2585](https://github.com/rust-lang/rfcs/blob/master/text/2585-unsafe-block-in-unsafe-fn.md) ### Example ```rust // An `unsafe fn` for demonstration purposes. // Calling this is an unsafe operation. unsafe fn unsf() {} // #[allow(unsafe_op_in_unsafe_fn)] by default, // the behavior of `unsafe fn` is unchanged unsafe fn allowed() { // Here, no `unsafe` block is needed to // perform unsafe operations... unsf(); // ...and any `unsafe` block is considered // unused and is warned on by the compiler. unsafe { unsf(); } } #[warn(unsafe_op_in_unsafe_fn)] unsafe fn warned() { // Removing this `unsafe` block will // cause the compiler to emit a warning. // (Also, no "unused unsafe" warning will be emitted here.) unsafe { unsf(); } } #[deny(unsafe_op_in_unsafe_fn)] unsafe fn denied() { // Removing this `unsafe` block will // cause a compilation error. // (Also, no "unused unsafe" warning will be emitted here.) unsafe { unsf(); } } ```
2021-03-09Bless tests.Camille GILLOT-97/+97
2021-02-25Add feature gate for inherent associate types.Olivier FAURE-0/+22
2021-02-19Support `pub` on `macro_rules`Vadim Petrochenkov-0/+49
2021-02-18Stabilize `unsafe_op_in_unsafe_fn` lintLeSeulArtichaut-36/+0
2021-02-15Add long explanation for E0545Jesus Rubio-0/+1
2021-02-07expand/resolve: Turn `#[derive]` into a regular macro attributeVadim Petrochenkov-6/+17
2021-02-06path trimming: ignore type aliasesDan Aloni-1/+1
2021-02-04add `relaxed_struct_unsize` feature gateBastian Kauschke-0/+24
2021-01-30Remove const_in_array_rep_exprkadmin-42/+0
2021-01-24Replace version_check dependency with own version parsing codeest31-30/+110
This gives compiler maintainers a better degree of control over how the version gets parsed and is a good way to ensure that there are no changes of behaviour in the future. Also, issue a warning if the version is invalid instead of erroring so that we stay forwards compatible with possible future changes of the versioning scheme. Last, this improves the present test a little.
2021-01-17Auto merge of #80942 - c410-f3r:tests-tests-tests, r=petrochenkovbors-0/+63
Move some tests to more reasonable directories - 2 All tests with a score equal or greater than 1.0 were moved to their respective directories by issuing ```bash cat FILE | tr -s " " | tr -d '():' | sort -k3 | awk '$3 >= 1' | cut -d " " -f1-2 | sed 's;\\;/;g' | xargs -n2 git mv ``` **Observation**: The first column values is the only column with results greater zero To attest the confidentiality of the model, some manual revision of at least of tests is needed and this process will be tracked in the following list: * `src/test/ui/abi/issue-28676.rs` OK #28676 * `src/test/ui/array-slice-vec/issue-15730.rs` OK * `src/test/ui/associated-types/issue-24338.rs` OK #54823 * `src/test/ui/associated-types/issue-48551.rs` Looks OK #48551 * `src/test/ui/associated-types/issue-50301.rs` Looks OK #63577 ... cc #73494 r? `@petrochenkov`
2021-01-16Move some tests to more reasonable directories - 2Caio-0/+63
Address comments Update limits
2021-01-16Rollup merge of #80971 - camelid:feature-gate-testsuite-organization, ↵Mara Bos-0/+41
r=Mark-Simulacrum Put all feature gate tests under `feature-gates/` There was one directory that had only a single test and there was also a test in the top-level directory. This moves both of them to `feature-gates/`.
2021-01-13Update tests for extern block lintingMark Rousskov-31/+28
2021-01-12Put all feature gate tests under `feature-gates/`Camelid-0/+41
There was one directory that had only a single test and there was also a test in the top-level directory. This moves both of them to `feature-gates/`.
2021-01-09resolve/expand: Improve attribute expansion on macro definitions and callsVadim Petrochenkov-12/+12
2021-01-05fixed feature gate stderrJake Vossen-1/+1
2021-01-01Auto merge of #80547 - lqd:const_generics_defaults, r=varkorbors-0/+30
In which we start to parse const generics defaults As discussed in this [zulip topic](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/const.20generic.20defaults), this PR extracts the parsing parts from `@JulianKnodt's` PR #75384 for a better user-experience using the newly stabilized `min_const_generics` (albeit temporary) as shown in #80507: trying to use default values on const generics currently results in parse errors, as if the user didn't use the correct syntax (which is somewhat true but also misleading). This PR extracts (and slightly modifies in a couple places) `@JulianKnodt's` parsing code (with attribution if I've done everything correctly), AST and HIR changes, and feature gate setup. This feature is now marked as "incomplete" and thus will also print out the expected "const generics default values are unstable" error instead of a syntax error. Note that, as I've only extracted the parsing part, the actual feature will not work at all if enabled. There will be ICEs, and inference errors on the const generics default values themselves. Fixes #80507. Once this merges, I'll: - modify the const generics tracking issue to refer to the `const_generics_defaults` gate rather than the older temporary name it uses there. - create the GH `F-const_generics_defaults` label r? `@varkor`
2021-01-01make `const_generics_defaults` use the unstable syntax mechanismRémy Rakic-10/+15
This is important to not accidentally stabilize the parsing of the syntax while it still is experimental and not formally accepted
2021-01-01add test for the `const_generics_defaults` feature gateRémy Rakic-0/+25
2021-01-01Move feature gate-related testsYuki Okushi-0/+3475
2020-12-26update testsBastian Kauschke-18/+8
2020-12-26delete no longer relevant testsBastian Kauschke-42/+0
2020-12-09Accept arbitrary expressions in key-value attributes at parse timeVadim Petrochenkov-0/+47
2020-12-07Validate naked functions definitionsTomasz Miąsko-5/+9
2020-11-29Update tests to remove old numeric constantsbstrie-4/+2
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-25Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obkbors-4/+4
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-24Auto merge of #79294 - petrochenkov:determ, r=varkorbors-64/+64
resolve: Do not put macros into `module.unexpanded_invocations` unless necessary Macro invocations in modules <sup>(*)</sup> need to be tracked because they can produce named items when expanded. We cannot give definite answer to queries like "does this module declare name `n`?" until all macro calls in that module are expanded. Previously we marked too many macros as potentially producing named items. E.g. in this example ```rust mod m { const C: u32 = line!(); } ``` `line!()` cannot emit any items into module `m`, but it was still marked. This PR fixes that and marks macro calls as "unexpanded in module" only if they can actually emit named items into that module. Diagnostics in UI test outputs have different order now because this change affects macro expansion order. <sup>*</sup> Any containers for named items are called modules in resolve (that includes blocks, traits and enums in addition to `mod` items).