Rocket/core/codegen/tests/ui-fail-nightly
Sergio Benitez 64e46b7107 Introduce sentinels: auto-discovered launch abort.
Sentinels resolve a long-standing usability and functional correctness
issue in Rocket: starting an application with guards and/or responders
that depend on state that isn't available. The canonical example is the
'State' guard. Prior to this commit, an application with routes that
queried unmanaged state via 'State' would fail at runtime. With this
commit, the application refuses to launch with a detailed error message.

The 'Sentinel' docs explains it as:

    A sentinel, automatically run on ignition, can trigger a launch
    abort should an instance fail to meet arbitrary conditions. Every
    type that appears in a mounted route's type signature is eligible to
    be a sentinel. Of these, those that implement 'Sentinel' have their
    'abort()' method invoked automatically, immediately after ignition,
    once for each unique type. Sentinels inspect the finalized instance
    of 'Rocket' and can trigger a launch abort by returning 'true'.

The following types are now sentinels:

  * 'contrib::databases::Connection' (any '#[database]' type)
  * 'contrib::templates::Metadata'
  * 'contrib::templates::Template'
  * 'core::State'

The following are "specialized" sentinels, which allow sentinel
discovery even through type aliases:

  * 'Option<T>', 'Debug<T>' if 'T: Sentinel'
  * 'Result<T, E>', 'Either<T, E>' if 'T: Sentinel', 'E: Sentinel'

Closes #464.
2021-04-16 01:44:53 -07:00
..
async-entry.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
async-entry.stderr Introduce statically-enforced 'Rocket' phasing. 2021-04-13 19:26:45 -07:00
bad-ignored-segments.rs Add tests for ignored parameters '<_>'. 2020-10-30 00:47:41 -07:00
bad-ignored-segments.stderr Revamp codegen, fixing inconscpicuous bugs. 2021-03-04 02:01:25 -08:00
catch.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
catch.stderr Revamp codegen, fixing inconscpicuous bugs. 2021-03-04 02:01:25 -08:00
catch_type_errors.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
catch_type_errors.stderr Update UI tests for latest nightly. 2020-09-06 18:34:24 -07:00
catchers.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
catchers.stderr Improve diagnostics, especially on stable. 2020-07-21 15:31:42 -07:00
from_form.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
from_form.stderr Allow several 'field' attributes in all derives. 2021-04-07 23:09:05 -07:00
from_form_field.rs UTF-8 routes. Forms revamp. Temp files. Capped. 2021-03-04 01:51:21 -08:00
from_form_field.stderr Allow several 'field' attributes in all derives. 2021-04-07 23:09:05 -07:00
from_form_type_errors.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
from_form_type_errors.stderr UTF-8 routes. Forms revamp. Temp files. Capped. 2021-03-04 01:51:21 -08:00
responder-types.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
responder-types.stderr Move catcher, route types into eponymous modules. 2021-04-13 18:58:05 -07:00
responder.stderr Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
route-attribute-general-syntax.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
route-attribute-general-syntax.stderr Introduce sentinels: auto-discovered launch abort. 2021-04-16 01:44:53 -07:00
route-path-bad-syntax.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
route-path-bad-syntax.stderr Introduce sentinels: auto-discovered launch abort. 2021-04-16 01:44:53 -07:00
route-type-errors.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
route-type-errors.stderr Remove second lifetime from 'FromRequest'. 2021-03-14 19:57:59 -07:00
route-warnings.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
route-warnings.stderr Improve diagnostics, especially on stable. 2020-07-21 15:31:42 -07:00
routes.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
routes.stderr Improve diagnostics, especially on stable. 2020-07-21 15:31:42 -07:00
typed-uri-bad-type.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
typed-uri-bad-type.stderr Revamp codegen, fixing inconscpicuous bugs. 2021-03-04 02:01:25 -08:00
typed-uris-bad-params.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
typed-uris-bad-params.stderr Revamp codegen, fixing inconscpicuous bugs. 2021-03-04 02:01:25 -08:00
typed-uris-invalid-syntax.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
typed-uris-invalid-syntax.stderr Improve diagnostics, especially on stable. 2020-07-21 15:31:42 -07:00
uri_display.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
uri_display.stderr Allow several 'field' attributes in all derives. 2021-04-07 23:09:05 -07:00
uri_display_type_errors.rs Implement codegen testing on stable. 2020-07-21 15:11:07 -07:00
uri_display_type_errors.stderr Revamp codegen, fixing inconscpicuous bugs. 2021-03-04 02:01:25 -08:00