about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-03-17Make negative coherence work when there's impl negative on super predicatesSantiago Pastorino-0/+18
2022-03-16erase late-bound regions in dyn projection types for debuginfoMichael Goulet-0/+7
2022-03-16Add double negative trait test caseSantiago Pastorino-0/+12
2022-03-16debuginfo: Fix ICE when generating name for type that produces a layout error.Michael Woerister-0/+44
2022-03-16resolve the conflict in compiler/rustc_session/src/parse.rscodehorseman-2/+2
Signed-off-by: codehorseman <cricis@yeah.net>
2022-03-16Reject `#[thread_local]` attribute on non-static itemsTomasz Miąsko-0/+68
2022-03-16Rollup merge of #94974 - c410-f3r:let-chain-dashufwrqwemkf-let-else, ↵Dylan DPC-0/+173
r=joshtriplett Ensure that `let_else` does not interact with `let_chains` As requested on https://github.com/rust-lang/rust/pull/94927. cc `@joshtriplett` `@estebank`
2022-03-16Rollup merge of #94951 - est31:irrefutable_let_chain_patterns, r=estebankDylan DPC-10/+159
Extend the irrefutable_let_patterns lint to let chains Implements the suggestion from https://github.com/rust-lang/rust/pull/94927#issuecomment-1067078300 We only look for complete suffixes or prefixes of irrefutable let patterns, so that an irrefutable let pattern in a chain surrounded by refutable ones is not linted, as it is an useful pattern that has no low-cost replacement (unlike suffixes or prefixes which can just be copied outside of the `if`: either into the `if`'s block, or the block surrounding the `if`). If all patterns in a let chain are irrefutable, we lint as well. Depends on #94958 ~~so I included it into the PR for now~~ *which has been merged since*. r? `@estebank` cc `@joshtriplett` `@c410-f3r`
2022-03-16Rollup merge of #94868 - dtolnay:noblock, r=Dylan-DPCDylan DPC-3/+3
Format core and std macro rules, removing needless surrounding blocks Many of the asserting and printing macros in `core` and `std` are written with prehistoric-looking formatting, like this: https://github.com/rust-lang/rust/blob/335ffbfa547df94ac236f5c56130cecf99c8d82b/library/std/src/macros.rs#L96-L101 In modern Rust style this would conventionally be written as follows instead, always using braces and a trailing semicolon on the macro arms: https://github.com/rust-lang/rust/blob/af53809c874e0afb7be966df4d3cfcaa05277c53/library/std/src/macros.rs#L98-L105 Getting rid of the unneeded braces inside the expansion reduces extraneous indentation in macro-expanded code. For example: ```rust println!("repro {}", true); ``` ```rust // before: { ::std::io::_print( ::core::fmt::Arguments::new_v1( &["repro ", "\n"], &[::core::fmt::ArgumentV1::new_display(&true)], ), ); }; ``` ```rust // after: ::std::io::_print( ::core::fmt::Arguments::new_v1( &["repro ", "\n"], &[::core::fmt::ArgumentV1::new_display(&true)], ), ); ```
2022-03-15Include tracking issue in diagnosticJacob Pratt-1/+1
2022-03-16Extend the irrefutable_let_patterns lint to let chainsest31-10/+159
Only look for complete suffixes or prefixes of irrefutable let patterns, so that an irrefutable let pattern in a chain surrounded by refutable ones is not linted, as it is an useful pattern.
2022-03-15Auto merge of #94925 - lcnr:relax-sus-auto-impls, r=estebankbors-1/+22
relax `suspicious_auto_trait_impls` lint wrt lifetimes fixes the warning for https://github.com/rust-lang/rust/issues/93367#issuecomment-1063993489.
2022-03-15Add deprecated_safe feature gate and attribute, cc #94978skippy10110-0/+28
2022-03-15Ensure that `let_else` does not interact with `let_chains`Caio-0/+173
2022-03-15Rollup merge of #94947 - Dylan-DPC:fix/typos, r=oli-obkMatthias Krüger-1/+1
fix typos Rework of #94603 which got closed as I was trying to unmerge and repush. This is a subset of changes from the original pr as I sed'd whatever typos I remembered from the original PR thanks to `@cuishuang` for the original PR
2022-03-15Update stderrs referencing `IntoIterator`mbartlett21-4/+4
2022-03-15Update const-fn-error.stderrmbartlett21-2/+2
2022-03-15Auto merge of #94584 - pnkfelix:inject-use-suggestion-sites, r=ekuberbors-15/+180
More robust fallback for `use` suggestion Our old way to suggest where to add `use`s would first look for pre-existing `use`s in the relevant crate/module, and if there are *no* uses, it would fallback on trying to use another item as the basis for the suggestion. But this was fragile, as illustrated in issue #87613 This PR instead identifies span of the first token after any inner attributes, and uses *that* as the fallback for the `use` suggestion. Fix #87613
2022-03-15Auto merge of #92285 - compiler-errors:dyn-proj-bounds, r=nikomatsakisbors-11/+85
check ~Projection~ all supertrait bounds when confirming dyn candidate I'm pretty sure Projection is the only other PredicateKind that we care about enforcing here. Fixes #80800
2022-03-15fix typosDylan DPC-1/+1
2022-03-14check all dyn obligations, actuallyMichael Goulet-11/+35
2022-03-14check Projection supertrait bounds when confirming dyn candidateMichael Goulet-0/+50
2022-03-14Rollup merge of #94670 - xFrednet:rfc-2383-expect-impl-after-party, ↵Matthias Krüger-0/+77
r=flip1995,wesleywiser Improve `expect` impl and handle `#[expect(unfulfilled_lint_expectations)]` (RFC 2383) This PR updates unstable `ExpectationIds` in stashed diagnostics and adds some asserts to ensure that the stored expectations are really empty in the end. Additionally, it handles the `#[expect(unfulfilled_lint_expectations)]` case. According to the [Errors and lints docs](https://rustc-dev-guide.rust-lang.org/diagnostics.html#diagnostic-levels) the `error` level should only be used _"when the compiler detects a problem that makes it unable to compile the program"_. As this isn't the case with `#[expect(unfulfilled_lint_expectations)]` I decided to only create a warning. To avoid adding a new lint only for this case, I simply emit a `unfulfilled_lint_expectations` diagnostic with an additional note. --- r? `@wesleywiser` I'm requesting a review from you since you reviewed the previous PR https://github.com/rust-lang/rust/pull/87835. You are welcome to reassign it if you're busy :upside_down_face: rfc: [RFC-2383](https://rust-lang.github.io/rfcs/2383-lint-reasons.html) tracking issue: https://github.com/rust-lang/rust/issues/85549 cc: `@flip1995` In case you're also interested in this :)
2022-03-14Rollup merge of #93977 - compiler-errors:sized-generic-metadata, r=wesleywiserMatthias Krüger-0/+91
Type params and assoc types have unit metadata if they are sized Extend the logic in `Pointee` projection to ensure that we can satisfy `<T as Pointee>::Metadata = ()` if `T: Sized`. cc: `@SimonSapin` and #93959
2022-03-14Rollup merge of #90621 - adamgemmell:dev/stabilise-target-feature, r=AmanieuMatthias Krüger-2/+2
Stabilise `aarch64_target_feature` This PR stabilises `aarch64_target_feature` - see https://github.com/rust-lang/rust/issues/90620
2022-03-14Stabilise `aarch64_target_feature`Adam Gemmell-2/+2
2022-03-14relax `suspicious_auto_trait_impls` lintlcnr-1/+22
2022-03-13Fix definition of Box in ssa-analysis-regression-50041.rsbjorn3-2/+2
The Box in liballoc always has a field for the allocator. It is quite hard to support both the old and new definition of Box in cg_clif so this change uses the new definition in this test too.
2022-03-13Auto merge of #94895 - matthiaskrgr:rollup-9hue5qk, r=matthiaskrgrbors-0/+17
Rollup of 3 pull requests Successful merges: - #94867 (Add regression test for `<i32 as Iterator>::count`) - #94886 (Update browser-ui-test version used in CI) - #94894 (Remove needless use of `Into`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-12Rollup merge of #94867 - notriddle:notriddle/i32-count-regression-test, ↵Matthias Krüger-0/+17
r=Dylan-DPC Add regression test for `<i32 as Iterator>::count` Closes #84495
2022-03-12Auto merge of #90358 - DevinR528:omitted-field-fix, r=jackh726bors-76/+412
Fix exposing fields marked unstable or doc hidden Closes https://github.com/rust-lang/rust/issues/89837 Work towards https://github.com/rust-lang/rust/issues/89554 Filter fields that are marked `doc(hidden)` or are unstable with that feature turned off. This brings structs and enums into alignment behavior-wise when emitting warning/errors about pattern exhaustiveness/reachability. cc `@Nadrieril`
2022-03-12Fix rebase conflicts with stderr filesDevin Ragotzy-53/+160
2022-03-12Only filter doc(hidden) fields/variants when not crate localDevin Ragotzy-9/+65
2022-03-12Update output for doc hidden usefulness ui test outputDevin Ragotzy-62/+64
2022-03-12Add struct to doc hidden usefulness ui testsDevin Ragotzy-11/+35
2022-03-12Add struct to stability ui tests in usefulnessDevin Ragotzy-15/+60
2022-03-12Update non-exhaustive omitted_patterns ui outputDevin Ragotzy-4/+46
2022-03-12Add unstable struct fields to ui testsDevin Ragotzy-2/+62
2022-03-12Auto merge of #94865 - ↵bors-0/+24
notriddle:notriddle/single-colon-path-not-const-generics, r=cjgillot diagnostics: single colon within `<>` probably, not type ascription Fixes #94812
2022-03-12Auto merge of #94711 - ouz-a:master3, r=oli-obkbors-0/+92
Return early to fix ICE This fixes #94627, ICE happens because compiler tries to suggest constraining type parameter but the only constraint is implicit `std::Sized` one, so it gets removed and there is nothing to suggest resulting in ICE.
2022-03-12Use consistent prose for `::`Michael Howell-2/+2
Co-authored-by: Camille Gillot <gillot.camille@gmail.com>
2022-03-12Auto merge of #94873 - DrMeepster:box_alloc_ice3, r=oli-obkbors-0/+6
Fix ICE when using Box<T, A>, again Sequel to #94043, fixes #94835.
2022-03-12Auto merge of #94870 - notriddle:notriddle/filter-regression, r=oli-obkbors-3/+3
diagnostics: do not spurriously claim something is "not an iterator" Fixes a minor regression caused by #94746, where `iter::Filter` is spurriously declared "not an iterator."
2022-03-12Rollup merge of #94833 - c410-f3r:meta-take-2, r=petrochenkovMatthias Krüger-83/+689
[2/2] Implement macro meta-variable expression Final part of https://github.com/rust-lang/rust/pull/93545#issuecomment-1050963295 r? `@petrochenkov`
2022-03-11fix another assumption about boxDrMeepster-0/+6
2022-03-11diagnostics: do not spurriously claim something is "not an iterator"Michael Howell-3/+3
Fixes a minor regression caused by #94746, where iter::Filter is spurriously declared "not an iterator."
2022-03-11Format core and std macro rules, removing needless surrounding blocksDavid Tolnay-3/+3
2022-03-11Add regression test for `<i32 as Iterator>::count`Michael Howell-0/+17
Fixes #84495
2022-03-11diagnostics: single colon within `<>` probably, not type ascriptionMichael Howell-0/+24
Fixes #94812
2022-03-11run rust-fix in amputate-span.rs. (Thanks to ekuber for pushing me to do this.)Felix S. Klock II-2/+73