about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-05-30Rollup merge of #97431 - compiler-errors:issue-97413, r=oli-obkMichael Goulet-0/+18
don't do `Sized` and other return type checks on RPIT's real type Fixes an ICE where we're doing `Sized` check against the RPIT's real type, instead of against the opaque type. This differs from what we're doing in MIR typeck, which causes ICE #97226. This regressed in #96516 -- this adjusts that fix to be a bit more conservative. That PR was backported and thus the ICE is also present in stable. Not sure if it's worth to beta and/or stable backport, probably not the latter but I could believe the former. r? `@oli-obk` cc: another attempt to fix this ICE #97413. I believe this PR addresses the root cause.
2022-05-30Rollup merge of #97172 - SparrowLii:unsafe_extern, r=compiler-errorsMichael Goulet-6/+37
Optimize the diagnostic generation for `extern unsafe` This PR does the following about diagnostic generation when parsing foreign mod: 1. Fixes the FIXME about avoiding depending on the error message text. 2. Continue parsing when `unsafe` is followed by `{` (just like `unsafe extern {...}`). 3. Add test case.
2022-05-30address commentsMichael Goulet-20/+86
2022-05-30better enum suggestionsMichael Goulet-0/+151
2022-05-30add regression testMichael Goulet-0/+41
2022-05-30fix typoMichael Goulet-29/+29
2022-05-30Add test for known-bugs of cfg_accessibleUrgau-6/+46
2022-05-30Add tests for private items of cfg_accessibleUrgau-0/+21
2022-05-30Add tests for "not sure" case of cfg_accessibleUrgau-0/+303
2022-05-30Handle more cases in cfg_accessibleUrgau-41/+42
2022-05-30normalize forbidden slicesMaybe Waffle-78/+79
2022-05-30Rollup merge of #97531 - compiler-errors:for-loop-pat-mismatch, r=davidtwcoDylan DPC-0/+43
Note pattern mismatch coming from `for` loop desugaring Fixes #97163
2022-05-30Rollup merge of #97504 - JohnTitor:cleanup-deps, r=davidtwcoDylan DPC-0/+37
Ensure source file present when calculating max line number Resubmission of #89268, fixes #71363 The behavior difference of `simulate-remapped-rust-src-base` is not something we should take into account here, so limiting targets to run the test makes sense, I think. r? `@davidtwco,` and `@estebank,` you might be interested in this change
2022-05-30test forbidden slices on all two usizesizesMaybe Waffle-28/+309
2022-05-30--blessMaybe Waffle-28/+28
2022-05-30Use `// error-pattern:` header in `forbidden_slices.rs` testMaybe Waffle-0/+1
2022-05-30Rename slice_from_ptr_range_const -> const_slice_from_ptr_rangeMaybe Waffle-2/+2
This is in line with other `const fn` features.
2022-05-30Add ui tests for `slice::from_{ptr_range,raw_parts}`Maybe Waffle-0/+481
2022-05-30Auto merge of #96964 - oli-obk:const_trait_mvp, r=compiler-errorsbors-141/+33
Replace `#[default_method_body_is_const]` with `#[const_trait]` pulled out of #96077 related issues: #67792 and #92158 cc `@fee1-dead` This is groundwork to only allowing `impl const Trait` for traits that are marked with `#[const_trait]`. This is necessary to prevent adding a new default method from becoming a breaking change (as it could be a non-const fn).
2022-05-30Remove `#[default..]` and add `#[const_trait]`Deadbeef-141/+33
2022-05-30Optimize the diagnostic generation for `extern unsafe`SparrowLii-6/+37
2022-05-30Bless tests with the full list of conventions in the outputScott McMurray-2/+2
2022-05-30Add support for emitting functions with `coldcc` in LLVMScott McMurray-0/+87
The eventual goal is to try using this for things like the internal panicking stuff, to see whether it helps.
2022-05-29Rollup merge of #97493 - compiler-errors:issue-97490, r=oli-obkMichael Goulet-0/+12
Use `type_is_copy_modulo_regions` check in intrisicck This one canoncalizes region variables correctly, preventing an ICE Fixes #97490
2022-05-29Add `let_underscore_drop` lint.Aaron Kofsky-0/+25
This lint checks for statements similar to `let _ = foo`, where `foo` is a type that implements `Drop`. These types of let statements cause the expression in them to be dropped immediately, instead of at the end of the scope. Such behavior can be surprizing, especially if you are relying on the value to be dropped at the end of the scope. Instead, the binding should be an underscore prefixed name (like `_unused`) or the value should explicitly be passed to `std::mem::drop()` if the value really should be dropped immediately.
2022-05-29Use type_is_copy_modulo_regions check in intrisicckMichael Goulet-0/+12
2022-05-29Note pattern mismatch coming from for-loop desugaringMichael Goulet-0/+43
2022-05-29Auto merge of #97456 - Bryysen:issue-97319-fix, r=compiler-errorsbors-60/+139
Improve error message for E0081 Closes #97319
2022-05-29Rebase fallout.Camille GILLOT-1/+1
2022-05-29Handle anonymous lifetimes properly in diagnostics.Camille GILLOT-2/+2
2022-05-29Fortify check for number of generic parameters.Camille GILLOT-4/+2
2022-05-29Make lifetime errors more precise in the presence of `Fresh` lifetimes.Camille GILLOT-20/+380
2022-05-29Harden bad placeholder checks on statics/constsYuki Okushi-7/+74
Co-authored-by: Fabian Wolff <fabian.wolff@alumni.ethz.ch>
2022-05-29Ensure source file present when calculating max line numberYuki Okushi-0/+37
Co-authored-by: Ross MacArthur <ross@macarthur.io>
2022-05-29Rollup merge of #97479 - JohnTitor:make-check-pass, r=compiler-errorsGuillaume Gomez-13/+11
Make some tests check-pass This touches the tests related to lint, parser, and importing, all of them should be fine with `check-pass`. r? ``@compiler-errors``
2022-05-29Rollup merge of #97028 - ridwanabdillahi:pretty-printer, r=michaelwoeristerGuillaume Gomez-8/+21
Add support for embedding pretty printers via `#[debugger_visualizer]` attribute Initial support for [RFC 3191](https://github.com/rust-lang/rfcs/pull/3191) in PR https://github.com/rust-lang/rust/pull/91779 was scoped to supporting embedding NatVis files using a new attribute. This PR implements the pretty printer support as stated in the RFC mentioned above. This change includes embedding pretty printers in the `.debug_gdb_scripts` just as the pretty printers for rustc are embedded today. Also added additional tests for embedded pretty printers. Additionally cleaned up error checking so all error checking is done up front regardless of the current target. RFC: https://github.com/rust-lang/rfcs/pull/3191
2022-05-29Rollup merge of #96950 - JohnTitor:issue-96395, r=compiler-errors,oli-obkGuillaume Gomez-0/+3
Add regression test for #96395 Closes #96395 This repeats "fixed" and "ICE", see https://github.com/rust-lang/glacier/pull/1243#issuecomment-1123768138 I think it's good to add a test before regressing again. r? ``@compiler-errors`` for quick reviiew cc ``@oli-obk`` you might want to check as you're familiar with MIR
2022-05-28Move some tests to more reasonable placesCaio-0/+0
2022-05-28Add E0788 for improper #[no_coverage] usageltdk-0/+129
2022-05-28Improve error message for E0081Bryysen-60/+139
Previously whenever a duplicate discriminant was detected for an Enum, we would print the discriminant bits in the diagnostic without any casting. This caused us to display incorrect values for negative discriminants. After this PR we format the discriminant signedness correctly. Also reworded some of the original error messages.
2022-05-28Auto merge of #97461 - eddyb:proc-macro-less-payload, r=bjorn3bors-9/+12
proc_macro: don't pass a client-side function pointer through the server. Before this PR, `proc_macro::bridge::Client<F>` contained both: * the C ABI entry-point `run`, that the server can call to start the client * some "payload" `f: F` passed to that entry-point * in practice, this was always a (client-side Rust ABI) `fn` pointer to the actual function the proc macro author wrote, i.e. `#[proc_macro] fn foo(input: TokenStream) -> TokenStream` In other words, the client was passing one of its (Rust) `fn` pointers to the server, which was passing it back to the client, for the client to call (see later below for why that was ever needed). I was inspired by `@nnethercote's` attempt to remove the `get_handle_counters` field from `Client` (see https://github.com/rust-lang/rust/pull/97004#issuecomment-1139273301), which combined with removing the `f` ("payload") field, could theoretically allow for a `#[repr(transparent)]` `Client` that mostly just newtypes the C ABI entry-point `fn` pointer <sub>(and in the context of e.g. wasm isolation, that's *all* you want, since you can reason about it from outside the wasm VM, as just a 32-bit "function table index", that you can pass to the wasm VM to call that function)</sub>. <hr/> So this PR removes that "payload". But it's not a simple refactor: the reason the field existed in the first place is because monomorphizing over a function type doesn't let you call the function without having a value of that type, because function types don't implement anything like `Default`, i.e.: ```rust extern "C" fn ffi_wrapper<A, R, F: Fn(A) -> R>(arg: A) -> R { let f: F = ???; // no way to get a value of `F` f(arg) } ``` That could be solved with something like this, if it was allowed: ```rust extern "C" fn ffi_wrapper< A, R, F: Fn(A) -> R, const f: F // not allowed because the type is a generic param >(arg: A) -> R { f(arg) } ``` Instead, this PR contains a workaround in `proc_macro::bridge::selfless_reify` (see its module-level comment for more details) that can provide something similar to the `ffi_wrapper` example above, but limited to `F` being `Copy` and ZST (and requiring an `F` value to prove the caller actually can create values of `F` and it's not uninhabited or some other unsound situation). <hr/> Hopefully this time we don't have a performance regression, and this has a chance to land. cc `@mystor` `@bjorn3`
2022-05-28Make some tests check-passYuki Okushi-13/+11
2022-05-28Auto merge of #97284 - b-naber:constraint-dyn-impl-suggestion, r=estebankbors-31/+82
Add suggestion for relaxing static lifetime bounds on dyn trait impls in NLL This PR introduces suggestions for relaxing static lifetime bounds on impls of dyn trait items for NLL similar to what is already available in lexical region diagnostics. Fixes https://github.com/rust-lang/rust/issues/95701 r? `@estebank`
2022-05-28Rollup merge of #97458 - estebank:use-self-in-derive-macro, r=compiler-errorsMatthias Krüger-0/+21
Modify `derive(Debug)` to use `Self` in struct literal to avoid redundant error Reduce verbosity in #97343.
2022-05-27proc_macro: don't pass a client-side function pointer through the server.Eduard-Mihai Burtescu-9/+12
2022-05-27Modify `derive(Debug)` to use `Self` in struct literal to avoid redundant errorEsteban Küber-12/+3
#97343
2022-05-27Add test for #97343Esteban Küber-0/+30
2022-05-28Add regression test for #81899Yuki Okushi-0/+30
2022-05-27Auto merge of #96046 - oli-obk:const_typeck, r=cjgillotbors-397/+759
Move various checks to typeck so them failing causes the typeck result to get tainted Fixes #69487 fixes #79047 cc `@RalfJung` this gets rid of the `Transmute` invalid program error variant
2022-05-27Update tests on aarch64Oli Scherer-127/+183